Created
September 20, 2019 01:20
-
-
Save sandikata/6db0c60452db49cc6739733011c1374c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /etc/services . | |
grep "^#" services > services_comments.txt | |
cat services | sed '/^\(#\|[[:space:]]*$\)/d;s/#.*//g' > services_wo_comments.txt | |
cat services | sed '/^\(#\|[[:space:]]*$\)/d;s/#.*//g' | grep udp >> services_udp.txt | |
vi services_wo_comments.txt | |
/socks | |
:+,$d | |
:w well-known-ports.txt | |
sed -n 1,100p well-known-ports.txt | sed "s/\//-/" > 100-well-known-ports.txt | |
#1 | |
cat > doc1.txt << EOF | |
10-IT-HQ | |
20-Accounting-HQ | |
30-Help-Desk-Remote | |
40-Sales-HQ | |
EOF | |
#2 | |
echo "10-IT-HQ" > doc1.txt | |
echo "20-Accounting-HQ" >> doc1.txt | |
echo "30-Help-Desk-Remote" >> doc1.txt | |
echo "40-Sales-HQ" >> doc1.txt | |
#1 | |
cat > doc2.txt << EOF | |
10-B.Thomas | |
20-J.Foster | |
30-G.Smith | |
40-F.Hudson | |
EOF | |
#2 | |
echo "10-B.Thomas" > doc2.txt | |
echo "20-J.Foster" >> doc2.txt | |
echo "30-G.Smith" >> doc2.txt | |
echo "40-F.Hudson" >> doc2.txt | |
cat doc1.txt doc2.txt > doc3.txt | |
find /etc -type f -size -200c -exec ls -al {} \; | tee small_etc_files.txt | |
#1 | |
cat doc3.txt | cut -d ' ' -f 3 | sort -u | |
#2 | |
awk < doc3.txt '{print $1}' | sort -u | |
cat doc3.txt| uniq -c | tee locations.txt | |
ПС: Не съм напълно сигурен дали съм разбрал правилно условията, но това е което знам и мога. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment