![]() ![]() The cd (change directory) command moves you into a different directory. Open a window, double-click on a folder, and then double-click on a sub-folder. The command for returning home is the cd command with no location specified (shorthand for cd ~): $ cd This directory is, more or less, your terminal's desktop-it's the place you find yourself staring at when you first open the terminal. If you're in one location because you used the cd command, you can "close" that location by going back to your home directory. You can always learn your current location with the pwd (print working directory) command: $ pwd In most shells, your prompt is a dollar sign ( $), and its location within the computer can change depending on where you tell your terminal to go. In a terminal, the closest thing to this concept is the shell prompt. For instance, when you open a window and click on the Documents folder icon, you think of yourself as being in your Documents folder. On a desktop, you judge your current location by what window you have open. You don't so much close a folder on the command line, as you leave it. To open-or enter-a folder on the command line, use the cd (change directory) command as follows: $ pwdĬlose the desktop window you're in, or press the Back button in your file manager to leave the folder. The cd (change directory) command opens a folder and makes it your new current working directory. If you're used to the dir command from Windows, you can use that on Linux as well. Plain text files are listed without additional notation. ![]() Binary entities, like ZIP files and executable programs, are indicated with an asterisk ( *). Colors don't always transmit over remote connections to distant servers, though, so a common and generic method to make it clear what are files and what are folders is the -classify ( -F) switch: $ ls -classifyįolders are given a trailing slash ( /) to denote that they are directories. If you don't see those colors, you can use ls -color to try and activate that feature. Some Linux distributions have colors pre-programmed so that folders are blue, files are white, binary files are green, and so on. You may also notice that it's hard to tell a file from a folder. Once you start moving around within your computer, you can use that information for reference. That is, you're in a folder inside of another folder. The double dot is an indicator that you can move back from this location. The single dot is a meta-location, meaning the folder you are currently in. From there, the ls (list) command shows you what's in that (or any other) directory: $ pwd The pwd (print working directory) command tells you what directory you're currently in. ![]() The ls (list) command lists all files in the current directory. To list the files on your computer or device, you generally open a file manager application, whether it's called Explorer (Windows), Finder (Mac), Nautilus (GNOME), Amaze (Android), or anything else. ![]() So instead of starting your journey with the shell by learning terminal commands, begin with everyday tasks that you're already familiar with. There are direct analogs for everything you do in a GUI to most of the everyday activities you do in a terminal. While the terminal may seem mysterious and intimidating at first, it's easy to learn once you realize that a terminal uses the same information as all of your usual applications. That is, this article demonstrates how to use a terminal to move around and browse your computer as you would on a desktop, but from a terminal instead. This article compares navigating a computer desktop without the desktop. As with any new tool, you have to learn the shell before you can do anything useful with it. Because of this direct communication without the intervention of additional applications, using a terminal also makes it easy to script repetitive tasks, and design workflows unique to your own needs. You may be surprised to learn, then, that there's a more direct way to use a computer: a terminal, or shell, which provides a direct interface between you and the operating system. You probably learned how to interact with a computer using a GUI, and you're probably very good at it. Cheat sheet: Old Linux commands and their modern replacements.Linux system administration skills assessment.A guide to installing applications on Linux.Download RHEL 9 at no charge through the Red Hat Developer program. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |