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.
ln
creates a link between files. Allow you to make a shortcut to a file.
wc
will print the number of words in a file.
rm -r arg1
removes arg1 directory.
chmod
change permissions on a file
chmod 754 hello.txt does what?
owner has read, write, and execute.
groups have read and execute.
others have read.
$USER
Gives current user’s name.
$PATH
Gives search path for commands.
$PWD
Gives the path of present working directory.
$HOME
Gives path of home directory.
$HOSTNAME
Gives name of the host.
$LANG
Gives the default system language.
$EDITOR
Gives default file editor.
$UID
Gives uer ID of current user.
$SHELL
Gives location of current user’s shell program.
What is Amazon EC2?
A virual computing environment.