Unix Flashcards
Where I am - Print working directory
pwd
List current directory content
ll, ls -al
read content of a file
cat fileName
clear the screen
clear
How to find unix version
cat /etc/issue
How to find cpu details
cat /proc/cpuinfo
How to find RAM on m/c
free -mto
Change directory
cd dirName
Go to root directory
cd /
Go to home directory
cd ~
Go to parent directory
cd ..
How to see command history
history
How to run a command from history
! CommandNumberFromHistoryList
Remove particular command from shell history
history – d
How to identify Directory/File in ls -al output
dxyzxyzxyz _xyzxyzxyz
How to identify link in ls -al output
lxyzxyzxyz
How to identify hidden file or directory in ls -al output
fileName/DirName will be prefixed with period
Tab completion
Tab - only one, Tab+Tab - if multiple files starts with same char.
Piping
ls | less
Chuck output into pages
less
Go to next page in Less output
Spacebar
Quit from Less output prompt
q
Is UNIX case sensitive
yes
How to get help on cat command
man cat
Copy file myFile to myNewFile
cp myFile myNewFile
Copy directory myDir to myNewDir
cp -r myDir myNewDir
Make folder myFolder
mkdir myFolder
Delete a file myFile
rm myFile
Rename a file myFile to myNewFile
mv myFile myNewFile
Wildcards
- one or more
Delete a dir myDir
rm -r myDir
duuugggooo USER GROUP
d=dir, uuu=user rwx permissions
What does x permission mean for directory
user can explore the folder
permission groups
u=user, g=group, o=other, a=all, r=read, w=write, x=execute,+=add permission, -=remove permissions, ==assign
Command to change permission on file/dir
chmod - Change Mod