Operating Systems & Administration

[Day 2] 2. Some more commands

D
DITISS Admin
••2 min read

File Information Using
stat

To retrieve specific information about a file, you can use the

stat
command in Linux. Here are some examples:

  1. Basic Usage:

    stat -c "%n, %F" file.txt

    • Output:
      file.txt, regular empty file
    • Description: Displays the file name and type.
  2. Detailed Usage:

    stat -c "name = %n, type of file = %F" file.txt

    • Output:
      name = file.txt, type of file = regular empty file
    • Description: Shows the file name and its type in a more descriptive format.

Creating Shortcuts with
alias

The

alias
command in Linux allows you to create shortcuts for longer commands, enhancing productivity. Here’s how to use it:

  1. Creating an Alias:

    alias ll='ls -la'

    • Explanation:

      • alias
        : Command used to define a shortcut.
      • ll
        : Name of the shortcut you want to create.
      • 'ls -la'
        : The actual command that will be executed when you type
        ll
        .
    • Benefit: Instead of typing

      ls -la
      every time, you can simply type
      ll
      .

  2. Viewing Existing Aliases:

    alias

    • Description: Displays a list of all current aliases.
  3. Removing an Alias:

    unalias <aliasname>

    • Description: Removes the specified alias from your session.

Read Next

8/26/2026

[Day 2] 3. Process Management

!3. ProcessManagement.png **Process**: Running an instance of a program. **Program**: A set of instructions for the machine (CPU). ### Compil...

8/26/2026

[Day 2] 4. Executable File

!4. Executable File.png ### **Executable File Structure** An executable file contains several key sections, each serving a specific purpose:...