Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

Basic Directory Commands > Command: ls - Pg. 438

438 AppendixA·UNIXBasics unsure, you would use the pwd command to determine the directory. Not all UNIX prompts show you which directory you are currently in. Let's get a little more creative and use the cd command with the pwd command. Change directories from /home to your current user (in our case, rshimonski) directory. Here is the syntax you would use: rshimonski@BEAST:/home> cd ~ rshimonski@BEAST:~> pwd /home/rshimonski rshimonski@BEAST:~> The most important thing to remember here is that you are learning how to navigate through the hierarchy and to see where your place is within it. Command: ls The ls command is also heavily used within the UNIX system. This command will probably become one of your most used commands when you work within the directory structure. The ls command lists filenames, sizes, modification and access times, and file types for you. There are also many options you can use with it. When you use ls, the default sort order of the directory listing will be alphabetical by name. You can, however, use options like -t to