Introduction Show
If you have worked in Linux, you may be familiar with the In this article, you will learn to use crucial Prerequisites
ls Command SyntaxLet’s start by explaining the syntax of the
Note: Additional instructions are case sensitive, so The most basic To execute this command, type ls Command Additional OptionsThe additional options detailed below give users more flexibility when using the
Type When you type the Run the To get the Inode (index node) number of all directories and files, type Sorting OptionsThere are three different sorting options that you can use:
You have the option to sort directories and files in the reverse order by typing Use the To sort directories and files alphabetically by entry extension type Note: If you want to learn how to sort file contents, refer to Linux sort command. View Hidden FilesWhen using the basic To get a full list of hidden files, type Directory Trees With the ls CommandIf you want to access long listing directory trees, type Type Advanced ls CommandsSo far, you have
learned simple
View Long Listing FormatRun the List UID and GID of FilesUse the Display Files in Human Readable FormatIf you want to check the size of files and directories in a human readable format, type View Reverse Output Order by DateWhen you type List Files by SizeRun the
Display Files Under /tmp DirectoryIf you want to access files in the /tmp directory, type Type View All ls CommandsTo list all Note: Next, learn how to create files in Linux text editors, such as Vim. See our Vim Cheat Sheet article that lists the most crucial Vim commands. Conclusion After reading this article, you have learned how to use the most
important What command can be used to confirm which directory you are in at a command line prompt?Use pwd to identify the current directory of your Terminal session. Use ls to list the files in the current directory of your Terminal session. Use cd and cd .. to change directories of your Terminal session.
What command can be used to display the last five lines of a text file?To look at the last few lines of a file, use the tail command. tail works the same way as head: type tail and the filename to see the last 10 lines of that file, or type tail -number filename to see the last number lines of the file.
What mode does the vi editor open by default?Command mode is the default mode for vi .
What key can be pressed to activate the bash shell's completion feature?One extremely time-saving feature built into the Bash Shell is the ability to "tab-complete" commands. Simply hit the tab key while you are typing a command, and the shell will automatically finish the command for you.
|