AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
File details linux9/9/2023 We use this information to address the inquiry and respond to the question. To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including: Questions and Inquiriesįor inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. Please note that other Pearson websites and online products and services have their own separate privacy policies. This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site. Use pwd to remind you where you are within the file system. You can accomplish the same thing by using the tilde ( ~) like this: cd ~ Finding Your Current Directory with pwd Environment variables are discussed in greater detail in Chapter 10, “Command-Line Master Class.” Type this command and press Enter to return to your home directory: cd $HOME You can also use the $HOME shell environment variable to accomplish the same thing. To return to your home directory from anywhere in the Linux file system, use the cd command like this: cd For example, to quickly move up to the parent directory, the one above the one you are currently in, use the cd command like this: cd. You can also use the cd command with several shortcuts. You can also specify an exact location for a directory, like this: cd /home/matthew/stuff/somedir That looks in the current directory for the somedir subdirectory, and then moves you into it. It might help you remember this command to think of it meaning “change directory.” The most basic usage of cd is this: cd somedir Use the cd command to move within the file system from one directory to another. For more information about redirects and combining commands, see Chapter 12, “Automating Tasks and Shell Scripting.” In the meantime, note that you can read the contents of that text file using the command less listing.txt, which lets you read the file bit by bit using the arrow keys to navigate in the file (or Enter to move to the next line), the spacebar to move to the next page, and q to exit when done. At the command line, you can use files as inputs to commands, or you can generate files as outputs as shown. The previous command sends the output of ls -laR to a file called listing.txt and demonstrates part of the power of the Linux command line. (Both files and subdirectories are included remember that the listing here is abbreviated.) Then, the details are as shown in Figure 9.1. The listing starts with the number of items in the directory. The listing (abbreviated here) is now given with one item per line, but with multiple columns. rw-r-r- 1 matthew matthew 675 16:48.profile ![]() localĭrwxr-xr-x 2 matthew matthew 4096 17:07 Musicĭrwxr-xr-x 3 matthew matthew 4096 6 18:07 Pictures bashrcĭrwxr-xr-x 13 matthew matthew 4096 10:42. ![]() To include details such as the file/directory permissions, owner and group (all of which are discussed later in this chapter), as well as the size, and the date and time it was last modified, enter the following: ls -alĭrwxr-xr-x 38 matthew matthew 4096 08:20. There is still more information available about each item in a directory. You can see all the hidden files by adding a switch to the command like this: ls -a. For this reason, they are not included in a basic directory listing. They are often used for configuration of specific programs and are not accessed frequently. Hidden files use filenames that start with a period (. However, using ls in this matter has some limitations. This is useful if I know what I am looking for but cannot remember the exact name. All directory listings in this chapter are abbreviated to save space.īy itself, the ls command shows just a list of names.
0 Comments
Read More
Leave a Reply. |