![]() ![]() $ sort -nr file.txt # sort the lines in file.txt numerically and in reverse order $ sort -r file.txt # sort the lines in file.txt in reverse order $ tar -czvf files/ #create a tar archived file containing the contents of the directory files/ Exploring and reorganizing file contents $ sort file.txt # sort the lines in file.txt (by default, alphabetically and ascending) $ cat file.txt #print the entire contents of file.txt $ tail -NUM file.txt #print the last NUM lines of file.txt (e.g. $ head -NUM file.txt #print the first NUM lines of file.txt (e.g. $ head file.txt #print the first 10 lines of file.txt $ file file.txt #print the type of the file (e.g. $ wc -l file.txt #print the number of lines in file.txt What the are these files? $ ls -lah file.txt #print the size of file.txt in bytes (also the date it was created) ![]() $ rm -r directory # remove directory and all the files within it (again, gone for good). $ rm file.txt # remove file.txt (be careful, it will be gone for good). $ mkdir new_directory # create a new diretory called new_directory ("make directory") $ cd ~/ # take me home ("change directories to the user's home directory") $ cd some/directory # go to some/directory ("change directory") $ pwd # print the directory where you are currently working ("print working directory") $ ls some/directory # list all the files in some/directory Bash : Greatest Hits Where am I? $ ls # list all the files in this directory ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |