Skip to content

Latest commit

 

History

History
39 lines (38 loc) · 2.04 KB

command_tips.md

File metadata and controls

39 lines (38 loc) · 2.04 KB

good things to know

  1. ls: list the contents of a directory
  2. cd: "change directory"
  • cd . go to the current directory.
  • cd .. go up a directory
  • cd ~ go home.
  • cd without a directory, go home.
  1. vi, nano text editors. :q quits vim.
  2. man the manual.
  3. sudo do as super-user. USE AT OWN RISK.
  4. ssh secure shell. Use to connect to servers.
  5. rm remove a file.
  6. mkdir make a directory.
  7. cp copy a file or directory
  8. mv move a file or directory
  9. git use Git commands.
  10. less read a file in the command line.
  11. !! replaced by previously run command. !1, !2,... go further back.
  12. cat output a file to the command line.
  13. echo print a message.
  14. cmd1 | cmd2 take the output of cmd1 and put it in cmd2. Called piping.
  15. cmd > file take the output of cmd and put it in a file. This replaces everything in the file. cmd >> file appends instead of overwriting.
  16. cmd1 && cmd2 and cmd1 || cmd2 Logical operations. Do cmd1 and cmd2, or cmd1 or cmd2.
  17. chown take ownership of a file. Useful if you download something as root.
  18. chmod make a file executable, among other uses.
  19. touch create a file. More precisely, update the modification time of a file, or create it if it doesn't exist.
  20. ssh-keygen generate a new ssh key for passwordless login on remote servers.
  21. wget download a file from the interwebz.
  22. top, htop, ps -eax display process information.

And now for something a little different.

  1. lolcat pipe a command into lolcat to make the output colorful. Some commands are broken for this.
  2. cowsay similar to lolcat, make a cow say the output.
  3. toilet make the output in big ASCII letters. Try mixing these three together to get some interesting results.
  4. sl make a train. A punishment to teach ls.
  5. ddate get the day in a fictional calendar.
  6. fortune get a random quote.
  7. neofetch display system information with a cool logo. Looks nicer than cat /proc/cpuinfo.
  8. cmatrix make it rain digital rain.