Linux Cut, Paste, Sort, Uniq, Tr, and Egrep - lets play

Subscribers:
1,230
Published on ● Video Link: https://www.youtube.com/watch?v=K4h8QhIAouo



Duration: 14:22
54 views
1


In this video we will play with the linux commands cut, paste, sort, uniq, tr, and egrep. We will do this by looking at the history of logged in users with last as well as looking for config files with passwords in them.

Commands in the video
2 man cut
3 man paste
4 man sort
5 last
6 last | grep -v ^reboot
7 last | grep -v ^reboot | more
8 last | grep -v ^reboot | tr -s ' '
9 man tr
10 last | grep -v ^reboot | tr -s ' ' | cut -d " " -f 1,5-
11 last | grep -v ^reboot | tr -s ' ' | cut -d " " -f 1
12 last | grep -v ^reboot | tr -s ' ' | cut -d " " -f 1 | sort
13 last | grep -v ^reboot | tr -s ' ' | cut -d " " -f 1 | sort | uniq
14 last | grep -v ^reboot | tr -s ' ' | cut -d " " -f 1 | sort | uniq 2(NOT ALLOWED) /dev/null
15 last | grep -v ^reboot | tr -s ' ' | cut -d " " -f 1 | sort | uniq | grep -v wtmp
16 ls
17 rm -rf playing/
18 mkdir playing
19 cd playing
20 for letter in {A..Z} ; do echo ${letter} (NOT ALLOWED) letter; done
21 more letter
22 more letter | wc -l
23 export x=0
24 while [ $x -le 25 ]; do echo "$x" (NOT ALLOWED) number; (( x++ )); done
25 more number
26 more number | wc -l
27 cat letter number
28 paste number letter
29 paste number letter letter number letter
30 man paste
31 paste -s number letter letter number letter
32 sudo find /etc -exec egrep -H [P,p][A,a][S,s]{2}[W,w} {} \;
33 sudo find /etc -exec egrep -H [P,p][A,a][S,s]{2}[W,w] {} \;
34 sudo find /etc -exec egrep -H [P,p][A,a][S,s]{2}[W,w] {} \; 2(NOT ALLOWED) /dev/null
35 sudo find /etc -exec egrep -H [P,p][A,a][S,s]{2}[W,w] {} \; 2(NOT ALLOWED) /dev/null | cut -f1 -d :
36 sudo find /etc -exec egrep -H [P,p][A,a][S,s]{2}[W,w] {} \; 2(NOT ALLOWED) /dev/null | cut -f1 -d : | sort | uniq
37 sudo find /etc -exec egrep -H [P,p][A,a][S,s]{2}[W,w] {} \; 2(NOT ALLOWED) /dev/null | cut -f1 -d : | sort | uniq | wc -l
38 sudo find /etc -exec egrep -H [P,p][A,a][S,s]{2}[W,w] {} \; 2(NOT ALLOWED) /dev/null | cut -f1 -d : | wc -l




Other Videos By Information Technology


2022-12-12I passed the Linux+ certification exam from CompTIA
2022-11-08Launch EC2 From AWS Lambda - This was done using an AWS Academy Learner Lab Account
2022-10-13Create Random Files in Learners Home Directories
2022-10-13Create 90 SFTP Only Users With a Single Command
2022-10-13Setting up a chrooted sftponly system for users in a specific group
2022-10-13Understanding Network Connections and installing Cups - Why do we print so much, arg! EC2 Metadata
2022-10-13Setup and Apache Web Server on AWS EC2
2022-10-13Systems Administrators Should Learn From Others Mistakes - Look at Standards
2022-10-13Playing with Split, Cat and Diff in linux using AWS
2022-09-23Finding files in linux and then doing something with that information (locate, find, updatedb, exec)
2022-09-22Linux Cut, Paste, Sort, Uniq, Tr, and Egrep - lets play
2022-09-22Cost of EC2 in AWS and touching on how to learn Regular Expressions
2022-09-22Getting ready to certify in Amazon Web Services (AWS)... Watch this video to get some tips
2022-09-19Setup a StarBound server in AWS on ubuntu
2022-09-15Some great features of the Canvas LMS and my course setup best practices
2022-09-15Linux combing and compressing (zipping) with tar. Simple reports with xargs and gpg for encryption
2022-09-13Creating links in Linux with a little intro to inodes and mounts
2022-09-13More on linux file permissions and login scripts. Added bonus of making a file unable to be deleted
2022-09-13Working with Linux file permissions and ownership chmod, chown, and chgrp
2022-09-12How to move a file up to a remote linux system with scp
2022-09-12Finding information in files. Stacking the grep command