Linux Commands Flashcards
cat filename
prints contents of file to screen
grep searchterm filename
search file for search term
sort filename
sort file alphabetically
sort -r filename
sort file z-a
uniq filename
removes duplicates that are beside each other
awk ‘{print $1, $2}’ filename
print column 1 and 2 of file
awk ‘{print $1, “eats”, $2}’ filename
prints column 1 and 2 with eats between them
wc filename
counts words in file
wc -l filename
counts number of lines in a file
pwd
prints pathway to folder
ls
prints contents of file your in
cd foldername
move into folder
cd ..
go back a folder
sort file > sorted_file.txt
create new file called sorted_file and save contents there
sort file»_space; sorted_file.txt
add the sorted contents of the file to the end of sorted file