Linux Flashcards
what does $pwd do
print working directory
what does $hostname do
my computer’s network name
what does $mkdir do?
make directory
what does $cd foo/ do
change directory to foo
what does $rmdir foo do
remove directory foo
what does $pushd do
push directory
what does $popd do
pop directory
what does $cp do?
copy file or directory
xargs
execute arguments
find
find files
grep
find things inside files
man
read a manual page
apropos
find what man page is appropriate
env
look at your environment
echo
print some arguments
export
export/set a new environment variable
what does $exit do?
exit the shell
sudo
DANGER! become super user root
What does Bash stand for?
Born again shell
what does $ls -a do?
list all files in the directory including hidden files.
what does $ls -l do?
list all files in the directory with detailed information
what does $ls -R do?
list all files recursively in directory and sub-directories
what does $ls -r do?
lists all files in the directory in reverse order
what does $ls -t do?
lists files by modification time
what does $touch foo do?
creates a new file foo
what does $file foo.bar do?
tells what type of file foo is
what does $cat foo.bar do
displays the contents of foo
what does $less foo.bar do?
allows navigation through file foo
what does $history do?
displays a history of commands
what does $clear do
clears the terminal
what does $cp foo.bar /new do?
copies foo.bar to directory new
what does $cp *.jpg Pictures/ do?
copies all files with the extension .jpg to the Pictures directory
what does $cp -r Pictures/ Downloads do?
copies all files from Pictures to Downloads overwrites any matching files
what does $cp -i foo.bar Documents/ do?
copies foo.bar to Documents directory but prompts before overwriting a similar file
what does $mv oldfile newfile do?
renames oldfile as newfile
what does $mv oldfile Stuff/ do?
moves oldfile to directory Stuff
what does $mv Things/ Stuff/ do?
renames Things to Stuff
what does $mkdir books paintings do?
makes a books directory and a paintings directory
what does $mkdir music/rock/punk/ do?
makes a directory music with a sub-directory rock which has a sub-directory punk
what does $rm file1 do?
permanently deletes file1
what does $rm -f file1 do?
force deletes file1 even if it is protected
what does $rm -r stuff/ do?
deletes the directory stuff and all of its files
what does rmdir stuff/ do?
removes the directory stuff only if it is empty
what does $find things/ file1 do?
finds a file named file1 in the things directory
what does $find -type d do?
finds all directories and sub directories
what does $help echo do?
displays a description and options for the echo command
what does $foo –help do?
displays a description and options for the executable foo
what does $man ls do?
displays a detailed manual for the ls command
what does $whatis ls do?
displays a brief description of the ls command
what does alias foobar=’ls -a’ do?
creates an alias that allows the commands ‘ls -la’ to be run by typing foobar