Linux Flashcards
Create a tree structure recursively
Mkdir -p ~/myFile/file/filenote
How to make a file with out gedit
touch filename
Kate fileName
vi fileName (I to insert, shift zz to exit)
Leafpad
All the ways to extract a bit of a file
sed -n 1~2p
-n line #; p print;
, inclusive range;
head
tail
How to find info on a specific command
man
Sort switches
sort -k 2d fileName
-k column #
2d column #\ data type
Column 2 alphanumeric
3n column 3 numerically
What does the crontab do?
Enables you to regularly schedule reoccurring jobs.
crontab -e
Join 2 files together column wise
Cat»_space; ~/trials/file1
For typing what to add
Cat file1»_space; file2
Joining 2 files
Know about the calendar
cal 05 2017
05 month
2017 year
You can’t specify the day
How to compress/ uncompress a file
Gzip -l file1
(To zip the file)
(Will give it a .gz)
gunzip file1.gz
How to get the unique files out of a file
uniq file one
(To view)
uniq file1 > uniqFile1
(To take out)
How to count stuff in a file
wc file1
(Just one file)
wc file1 file2 file3
(You can do more then one file at a time)
What do the wild cards do
*0 or more matching chars in a fileName
?represents a single char
[] A range
Absolute path and relative path
View the parent of:
/home/student/devices/routers/
Absolute:
ls /home/student/devices/
relative:
ls ..
Create a link to the:
/home/student/inventory
ln -s /home/student/inventory /home/student/inventory.bak
Must use absolute path
To unlink:
unlink
Understand the permissions
(-)[---]{---} 11 ()file type []you {}group <>other 11 # of hard links Directory, read, wright, execute, -file