lab
1: change directories
2:find out which directory you are in
3: find out which user you are
4: change password
5: go to root
6: show what is inside of the directory
7: become root
8: change users
9: clean the screen
10: go one directory back
11: create a file
12:list all files by when it was last modified
13: copy a file and rename it
14: create a directory
15: copy a directory
16: start the search for a file from current working directory
17: search using locate
18: the locate command doesn’t ouput any result
19: install the locate command
20: brace expansion abc
21: list every file that starts with abc
22: remove every file that starts with abc
23: create a hard link
24: create a soft link
25: remove write permissions for a group from file named jerry
26: view file permissions
27: remove file permission for everyone
28: remove file permission for user
29: change ownership of a file
30: change group of a file
31: add ACL permission for user
32: add ACL permissions for a single group
33: remove a specific ACL entry
34: remove all ACL’s
35: verify acl changes
36: remove acl
37: remove a specific group’s acl
38: output ls -l to a file (not a directory)
39: 3 types of help commands
40: write text to a file
41: view hidden files
42: route an error message to a file
43: tee command with hello world
44: » for tee
45: see how many characters a file has
46: get the last line
47: create a directory and create an empty text file all on one file
48: copy a file
49: remove a file
50: move a file
51: create a directory
52: remove a directory
53: change group ownership
54: change file ownership
55: get the newest file listed at the bottom
56: cut the first letter of every line
57: cut out a range of characters
58: Use AWK to get the first column (or specify a column)
59: use awk to list the first and third field of ls -l output
60: search for a specific word using AWK
61: get the first field using a delimiter + AWK
62: get lines that have more than 15 bytes using awk
63: find the total number of fields using awk
64: search for a keyword in a file using grep
65: search for a keyword and count it using grep
66: search for a keyword and ignore CASE-sensitive
67: display the matched line and matched keyword (so 1:seinfeild, 8 seinfeild)
68: display everything but the keyword
69: search for a keyword but only give the 1st field
70: search for 2 keywords
71: compare 2 files (to see what is similar and what isn’t) line by line
72: compare 2 files to see the difference in byte sizes
73: check file line count, word count and byte count
74: get the number of lines in a file
75: get the number of words in a file
76: get the number of bytes in a file
77: get the number of files
78: Alphabetical order sorting command
79: alphabetical order reverse → sort
80: Sort By field number
81: uniq <file>
82: sort first, then uniq and list count
83: only show repeated lines
84:
1a: cd
2a: pwd
3a:whoami
4a: password user-id
5a: cd /
6a: ls
7a: su -
8a: su username
9a: clear
10a: cd ..
11a: touch filename
12a: ls -ltr
13a: cp filename new-filename
14a: mkdir filename
15: cp -R source destination
16: find / -name “filename”
17: locate -i filename
18: updatedb
19: yum install mlocate
20: touch abcd{1..9}
21: ls abc*
22: rm abc*
23: ln <source> <link-name>
24: ln -s <source> <link-name>
25: chmod g-w jerry
26: ls -l <filename>
27: chmod a-r <filename>
28: chmod u-r <filename>
29: chown <user-name> <file-name>
30: chgrp <group-name> <file-name>
31: setfacl -m u:<user>:rwx </path/to/file>
32: setfacl -m g:<group>:rwx </path/to/file>
33: setfacl -x u:<user>: </path/to/file>
34: setfacl -b <path/to/file>
35: getfacl /path/to/file
36: setfacl -rm <entry> /path/to/file
37: setfacl -x g:groupname filename
38: ls -l » <filename>
39: → whatis <command>
→<command> --help
→man <command>
40: Echo “Hello my name is” » filename
41: ls -la filename
42: ls -l 2> file
43: echo “Hello world” | tee <file-name>
44: | tee -a
45: wc -c filename
46: ls - l | tail
47: mkdir <name> ; cd <name> ; touch <file-name>
48: cp <filename>
49: rm <filename>
50: mv source destination
51: mkdir <name>
52: rmdir
53: chgrp
54: chown
55: ls -ltr
56: cut -c1 <filename>
57: cut -c1-3 <filename>
58: awk ‘{print $1}’ <filename>
59: ls -l | awk ‘{print $1,3}’
60: awk ‘<word> {print}’ <file>
61: awk -F: ‘{print $1}’ <filename>
62: awk ‘length ($0) > 15 ‘ <filename>
63: ls -l | awk ‘{print NF}’
64: grep <keyword> file
65: grep -c keyword file
66: grep -i keyword file
67: grep -n keyword file
68: grep -v keyword file
69: grep keyword file | awk ‘{print $1}’
70: egrep -i '“keyword1|keyword2” file
71: diff <file1> <file2>
72: cmp <file1> <file2>
73: wc <file>
74: wc -l file
75: wc -w file
76: wc -b file
77: ls -l | wc -l
78: sort <file>
79: sort -r <file>
80: sort -k2 <file
81: sort file | uniq
82: sort file | uniq -c
83: sort file | uniq -d