Unix Commands Flashcards
To familiarize those with some basic Unix shell commands. Credit goes to http://freeengineer.org/learnUNIXin10minutes.html for the list of Unix command I made the flash cards from. (41 cards)
ls
list directory contents
cd
change directory
mkdir
make directory
cp [file1] [file2]
copys a file
mv [file1] [file2]
move or rename a file
/
root directory
/usr
usr directory
chmod 755 file
Changes the permissions of file to be rwx for the owner, and rx for the group and the world. (7 = rwx = 111 binary. 5 = r-x = 101 binary)
ls -a
List all files in current directory including hidden files
ls -l
list a directory in long ( detailed ) format
cat filename
Dump a file to the screen in ascii.
echo $SHELL
Denotes what shell you are using.
export PROJECTS=/usr/local/projects
Defines the environment variable PROJECTS with the value /usr/local/projects.
cd $PROJECTS
Changes your present working directory to the value of the environment variable PROJECTS
echo $PROJECTS
Prints out the value of PROJECTS, or /usr/local/projects
find . -name aaa.txt
Finds all the files named aaa.txt in the Current directory or any subdirectory tree.
find / -name vimrc
Find all the files named ‘vimrc’ anywhere on the system.
find search_path -name filename
Find command
chown bruce file
Makes user bruce owner of file
chown -R bruce dir
Makes user bruce owner of directory and everything in its directory tree.
chgrp user file
Makes file belong to the group user.
~
Home directory
rm file1 [file2 …]
Remove or delete a file
rm -r dir1 [dir2…]
recursivly remove a directory and its contents