Created On: March 28, 2023, Last Updated On: March 29, 2023

Unix/Linux useful commands

Public

By Ozzie Ghani3 new






# cat -A file.txt 
foo$
bar$


# file file.txt 
file: ASCII text


unix2dos
# unix2dos file.txt 
unix2dos: converting file file.txt to DOS format...

# file file.txt 
file.txt: ASCII text, with CRLF line terminators

# cat -A file.txt 
foo^M$
bar^M$

# cat -v file.txt 
foo^M
bar^M


dos2unix
# dos2unix file.txt 
dos2unix: converting file file.txt to Unix format...

# file file.txt 
file.txt: ASCII text

# cat -A file.txt 
foo$
bar$

# cat -v file.txt 
foo
bar

pgrep
pgrep nginx # will list all processes whose commands match nginx

pgrep -f nginx # will list all processes whose entire command lines match nginx

pgrep -x nginx # will list all processes whose commands exactly match nginx