90 likes | 219 Views
Day 19. Ailases. aliases. Sometimes its just hard to remember a command. If you know your going to have problems remembering it…make an alias for it. Example…type just an “l” (lower case L) and hit enter. Weird…it ran “ls” This is a default alias made for us who mistype a lot.
E N D
Day 19 Ailases
aliases • Sometimes its just hard to remember a command. • If you know your going to have problems remembering it…make an alias for it. • Example…type just an “l” (lower case L) and hit enter. • Weird…it ran “ls” • This is a default alias made for us who mistype a lot.
Making a new alias • Lets imagine we can never remember the command “more”. • alias showme=more • Now you can do: • showme filename • And it will run: • more filename
Seeing all your aliases • Just type • alias • To see all currently defined aliases. • Remember an alias is only valid until you log out. If you want it to be there forever, add it to your .bashrc file.
Example tar • tar stands for Tape ARchive. • Origionally it was created to write information to backup tapes. • However, its also useful to put a bunch of files together into one file.
Making a tar file • Imagine you have a directory called homeworks • In it, there are 5 files, hw1 hw2 hw3 hw4 and hw5 • You could do the followingcd homeworkstar cvf homeworks.tar * • This would create a file called homeworks.tar which contains the 5 homework files.
Seeing whats in a tar file • If you type: • tar tf homeworks.tar • You would see a list of what is in the tar file: • hw1, hw2, hw3, hw4, hw5
Getting things out of a tar file • tar xvf homeworks.tar • Would extract verbosely from the file homeworks.tar.
Make the following aliases • mktar • Which should run tar cvf • lstar • Which should run tar tf • untar • Which should run tar xvf