Notes

Commands

This is not a comprehensive list of commands by any means and making one does not make any sense. Each command has its purpose and as such I will not explain them, each person will stumble upon commands in their path while using Linux. Here I listed what I think are the most useful to start. #cd

  • Used to navigate inside the #Filesystem, some shortcut are:

    • cd -: jump back to the directory we were last in.
    • cd ..: go to the parent directory
    • cd .: remains in the current directory #ls
  • List the files in the current directory (also directories as they are represented as files).

      ```sh
    $ ls -la
    
    total 403188
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:37 .bash_history
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:37 .bashrc
    ...SNIP...
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:37 Desktop
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:34 Documents
    drwxr-xr-x 3 cry0l1t3 htbacademy 4096 Nov 15 03:26 Downloads
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:34 Music
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:34 Pictures
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:34 Public
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:34 Templates
    drwxr-xr-x 2 cry0l1t3 htbacademy 4096 Nov 13 17:34 Videos
    

- Each row has the following format:
      `[permission] [number of hard links] [owner] [group owner] [size of the file] [date and time] [directory/file name]`
- To understand permissions -> Linux/Permissions. The one in the example are the standard ones.

#mkdir
- Create directory
#man
- Utility to get the documentation of practically everything about the Linux system (if the right pages are installed). Example:
        ```sh
      $ man ls
      LS(1)                            User Commands                           LS(1)
      NAME
           ls - list directory contents
- SYNOPSIS
           ls [OPTION]... [FILE]...
- DESCRIPTION
           List  information  about  the FILEs (the current directory by default).
           Sort entries alphabetically if none of -cftuvSUX nor --sort  is  speci‐
           fied.
- Mandatory  arguments  to  long  options are mandatory for short options
           too.
- -a, --all
                  do not ignore entries starting with .
- -A, --almost-all
                  do not list implied . and ..
- --author
      Manual page ls(1) line 1 (press h for help or q to quit)

#apropos

  • search the manual page names and descriptions #SSH
  • Secure shell #id
  • Similar to the whoami command but gives back more informations about the user we are logged in with: ```sh $ id uid=1000(momo) gid=1000(momo) groups=1000(momo),4(adm),24(cdrom),27(sudo),30(dip),
    46(plugdev),100(users),111(kismet)
#uname
- This command is useful to get information about the system we are utilizing, such as the kernel version:
        ```sh
      $ uname -a
      Linux hostname 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC \
      Thu Jun  5 18:30:46 UTC 2025 x86_64 GNU/Linux

#chmod, #chown, #chgrp #stat

  • Displays crucial information such as file size, permissions, ownership, and timestamps, making it an essential utility for system administrators and power users. #find
  • Used to find files across the filesystem, powerful and filter driven. To learn more look at its #man page #grep
  • Search/filter text by pattern (very common in pipelines). #sort
  • Sort lines of text (often used with uniq for de-duplication). #lsof
  • List open files (useful to find which process keeps a filesystem busy). #fdisk
  • Partition table editor/viewer (use carefully on disks). #mkswap, #swapon
  • Create and enable swap space. #iptables
  • Configure the netfilter firewall (legacy; nftables is the modern replacement).