UNIX COMMANDS Flashcards
cp -r arg1 arg2
copy content of arg1 directory to the arg2 directory.
man command
will print the manual for using a specific command.
cd
change directory.
cd /
go to root directory.
cd ~
go to home directory.
cd ..
navigate one directory up.
cd ./arg1/arg2
navigate into arg2 directory which is inside arg1 directory.
ls
allows us to see the contents of the current directory.
ls -a
allows you to see hidden items in a directory.
ls arg1
allows us to see the contents in the arg1 directory.
mkdir
allows us to create a new directory.
pwd
prints the directory you’re currently working in.
echo
command that will print a string or the result of a command to the console.
touch
creates a file but also allows you to modify the timestamp of a file. (Usually used to create empty files).
cat > filename
creates a new file
cat filename
Displays the file content
mv file “new file path”
moves the files to the new location
mv filename new_file_name
Renames the file to a new filename.
rm filename
Deletes a file.
clear
clears the terminal
rmdir
Deletes a directory.
mkdir directoryname
creates a new directory in the present working directory or at the specified path.
grep
prints any lines in a file or files that match a given pattern.
rm
will remove a file.