command line commands Flashcards
what is the man (command shortcut) command?
e.g. man cat
it gives you the manual for the given command shortcut (in this case, cat, or catalog)
what is the cat (file name) command?
you can use cat (file) to print the contents of one file, or more than one by simply adding more arguments to the command line
e.g.
cat laziness.txt impatience.txt
it can also be used with the > command to combine the contents of files INTO new files, like this:
cat laziness.txt impatience.txt hubris.txt > three-virtues.txt
the above would create a new file named “three-virtues.txt”
what is the ls (file name) command?
it gives you a list of ALL the files in a directory. simply type the argument “ls” w/nothing else
what is the cat (file name) command?
what is the pwd command?
it prints the name (file path) of the current working directory
what is the ls command?
it gives you a list of files in a directory
what is the echo command?
it allows you to write a line of text, and you can write to a file like this:
echo ‘Hello, World!’ > hello.txt
what is the mcdir command?
it makes directories, like this:
mcdir parent
what is the touch command?
it changes the file timestamp
use the man touch comment for more info
what is the mv command?
it allows u to move or rename files
e.g.
mv poikemon pokemon fixes pokemon’s spelling by changing it
what is the rm command?
it removes files or directories
e.g.
rm lol.txt for files or
rm kill-me/ for files
what is the rm command?
copy files or directories
e.g.
cp and-then.txt no-and-then.txt
copies the former to a new file, the latter