Useful cmds for linux/unix

3 min read

Linux file system & hierarchy

“Linux Hierarchy and File System: Navigating Paths to Digital Mastery.”

Linux Hierarchy & File system

How to use terminal

Opening a terminal in Linux depends on your desktop environment. Here are a few common ways:

  1. Keyboard Shortcut:
    • Press Ctrl + Alt + T – This is a common shortcut for many Linux distributions.
  2. Application Menu:
    • Look for an application menu. It’s often represented by an icon resembling a terminal or the word “Terminal.” You can find it in different places depending on your desktop environment (e.g., GNOME, KDE, XFCE).
  3. Right-Click on Desktop or File Manager:
    • In some environments, you can right-click on the desktop or within a file manager window and find an option like “Open Terminal” or “Open Terminal Here.”
  4. Search:
    • Many Linux desktop environments have a search feature. Press the super key (usually the Windows key) and start typing “Terminal” or “Console.”
  5. Use a Run Command:
    • Press Alt + F2 to open a “Run” dialog and type in the name of the terminal emulator (e.g., gnome-terminal, konsole, xterm).

The specific steps may vary depending on the Linux distribution and desktop environment you are using. If you’re unsure, you can check your system documentation or do a quick online search based on your distribution and desktop environment.

Useful cmds for Linux

Using Linux can be a bit different from other operating systems, but once you get the hang of it, it’s quite powerful. Here are some basic commands to get you started:

  1. Navigating the File System:
    • cd: Change directory. Use cd [directory] to move around.
    • ls: List files in the current directory.
    • pwd: Print the current working directory.
  2. Manipulating Files and Directories:
    • mkdir: Create a new directory. Example: mkdir new_folder.
    • touch: Create a new empty file. Example: touch new_file.txt.
    • cp: Copy files or directories. Example: cp file.txt /path/to/destination.
    • mv: Move or rename files or directories. Example: mv file.txt new_location/file.txt.
    • rm: Remove files or directories. Be careful with this one. Example: rm file.txt.
  3. Viewing and Editing Files:
    • cat: Concatenate and display the content of files.
    • nano or vim or emacs: Text editors. Choose one and learn its basics. Example: nano filename.
  4. System Information:
    • uname -a: Display system information.
    • df -h: Show disk space usage.
    • free -m: Display available memory.
  5. Package Management (for Debian-based systems like Ubuntu):
    • sudo apt update: Update package lists.
    • sudo apt install [package]: Install a new package.
    • sudo apt upgrade: Upgrade installed packages.
  6. User Management:
    • sudo adduser [username]: Add a new user.
    • sudo passwd [username]: Set a password for the user.
    • sudo usermod -aG [group] [username]: Add a user to a group.
  7. Process Management:
    • ps: Display information about active processes.
    • kill [process_id]: Terminate a process.
  8. Network Commands:
    • ifconfig or ip addr show: Show network interfaces and IP addresses.
    • ping [hostname]: Check connectivity to a server.

Remember, the key is practice. Don’t be afraid to experiment in a safe environment. Also, there are tons of resources online, forums, and communities where you can seek help if needed.

You May Also Like

More From Author

+ There are no comments

Add yours