background
loading scroll to btns
Back To Home
notes
2 min readOctober 12, 2023

๐Ÿ– linux commands

linux

i know

  • killall terminate a program, not the best so you can check bpytop
  • touch create a file, modify the access time of a file
  • which where a program is
  • ping test network
  • less <file> or cat <file> | more better than cat when creating long files
  • sudo blkid list all the devices on a machine, find the uuid for a device
  • sudo -s act as a root for some time instead of typing sudo every time
  • su <user> change user
  • sudo allows us to act as the root user

Piping / chaining

ls | cat allowing the standard output from the ls command to be the standard input for the cat command e.g: cat contacts.txt | sort | uniq | grep something

running multiple commands at once

  1. using ; run both commands
  2. using && run the second command if the first succeeds
  3. using || run the second command if the first fails

e.g: mkdir hi && cd hi

the find command

find <locationToSearch>

redirection

Redirecting the output into a file

echo hi > hi.txt overwrite redirection echo hi >> hi.txt append redirection e.g: sort < contacts.txt > sorted-contacts.txt

sudo

sudo !! Run sudo to the previous command

Comments