Lab



1: Remotely Access Linux Machine

2: Remote into linux with username

3: get ip address

4: get prompt back

5: get username

6: Get Hostname

7: change password

8: go to a different directory 

9: find which directory you are currently in   

10: list contents of a file

11: become root

12: wipe the screen

13: go one directory back

14: create a file

15: copy an existing file

16: create a directory

17: check that file/directory was created

18: list files by when they were last modified

19: create vi file

20: create multiple files

21: copy a directory

22: use the find command to search for a file from current directory

23: search for file using locate

24: update locate database

25: search using find from root directory

26: remove a file

27: remove a directory

28: create a hard link

29: create a soft link

30: write to a file

31: read what you wrote to a file

32: find inode

33: list by oldest at top and newest at bottom

34: list only one file

35: delete a directory

36: create a directory

37: get the options for a command

38: add permissions for a group to a file

39: add permissions for a user to a file

40: change ownership of a file

41: change group of a file

42: add acl permission for a user

43: add acl permissions for a group

44: allow all files or directories to inherit ACL’s from the directory it is within (When you create a new file or directory inside a directory, it should automatically receive the ACL permissions defined on the parent directory.)

45: remove a specific ACL entry

46: remove all acl entry’s for everyone

47:



1a: ssh 192.168.1.1

2a: ssh -l <username> <ip-address>

3a: ip addr

4a: ctrl + c

5a: whoami

6a: hostname

7a: passwd userid

8a: cd

9a: pwd

10a: ls <filename>

11a: su -

12a: clear

13a: cd ..

14a: touch <filename>

15a: cp <filename> <new-file>

16: mkdir

17: ls -l

18: ls -ltr

19: vi <filename> → :wq!

20: touch file1 file2 file3

21: cp -R <source> <destination>

22: find . -name “<name>”

23: locate <filename>

24: updatedb

25: find / -name “<name>”

26: rm

27: rm -r or rmdir

28: ln <source> <destination

29: ln -s <source> <destination>

30: echo “<text>”

31: cat <file>

32: ls -li

33: ls -ltr

34: ls -l <file>

35: rm -r <directory>

36: mkdir <name>

37: man <command>

38: chmod g+rwx <file>

39: chmod u+rwx <file>

40: chown

41: chgrp

42: setfacl -m u:user:rwx /path/to/file

43 setfacl -m g:group:rwx /path/to/file

44: setfacl -Rm “entry” /path/to/file

45: setfacl -x u:user /path/to/file (for a specific user)

46: setfacl -b /path/to/file

47:















































OLDDDDD



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