Linux Fundamentals PT2 Flashcards
(42 cards)
What command is used to set ACLs on files?
setfacl
What command is used to view ACLs?
getfacl
What option adds a permission for a user with setfacl?
setfacl -m u:username:rw file
How do you remove an ACL entry?
setfacl -x u:username file
What command is used to check disk usage of a file or directory?
du
What command is used to check disk space on filesystems?
df
What command removes empty directories?
rmdir
How do you securely delete a file?
shred -u filename
How do you display the content of a file?
cat file
How do you show file contents one page at a time?
less file or more file
How do you display the beginning of a file?
head file
How do you display the end of a file?
tail file
How do you watch a file change in real time?
tail -f file
What does ‘cut’ do?
Cuts selected portions from each line of a file
What is an example of ‘cut’?
cut -d’,’ -f1 file.csv (extract first column)
What does ‘awk’ do?
Pattern scanning and processing language
Give a simple ‘awk’ example
awk ‘{print $1}’ file.txt
What does ‘grep’ do?
Searches for patterns in files
What is ‘egrep’?
Extended grep for advanced regex (same as grep -E)
What does ‘sort’ do?
Sorts lines of text files
What does ‘uniq’ do?
Removes duplicate lines from sorted input
What does ‘wc’ do?
Counts lines, words, bytes
What does ‘diff’ do?
Compares files line by line
What does ‘cmp’ do?
Compares files byte by byte