Module 1 Flashcards
ls /
ls -l
list contents of directory
- list -l = gives more details of directory items
cd
change directory
tab
autofill command or name
pwd
Print Name of Working Directory
mkdir
make new directory
mkdir -p
create necessary parent directories
- eg. mkdir -p testparent/testkid = testkid within testparent directory
cd ../
move up one directory per ../
rm /
rm -r
- rm = remove file
- rm -r = remove directory (recursive)
CANNOT BE UNDONE
rwx
read (read only)
write (write only)
execute (run the file)
rwx
octal permission values
- none = 0
- read = 4
- write= 2
- execute = 1
touch
create new file
head /
head -n integer
outputs first 10 lines of text
- option -n : specify number of lines to output
- eg. head -n 5 = first 5 lines
tail /
tail -n integer
outputs last 10 lines of text
- option -n: specify number of lines to output
- eg. tail -n 5 = last 5 lines
grep
searches files for matching patterns
- eg. grep “the” poems.txt
cd ~/directory name
changes to named directory from home directory
chmod
changes permission mode string (eg. rwx)