Skip to content

Remove the directory

Remove the directory in Basic Commands.

4 min read Updated SS

Remove the directory#

rmdir <directory name>

For Example:

rmdir troubleshooting guide

Expected Output: Once the above command is executed, there wont be any visible output. Hence check the same by executing the below command:

ls -lrt

Output:

total 906640
drwxr-xr-x.   2 root          6 Jun 21  2021 srv
lrwxrwxrwx.   1 root          8 Jun 21  2021 sbin -> usr/sbin
drwxr-xr-x.   2 root          6 Jun 21  2021 mnt
drwxr-xr-x.   2 root          6 Jun 21  2021 media
lrwxrwxrwx.   1 root          9 Jun 21  2021 lib64 -> usr/lib64
lrwxrwxrwx.   1 root          7 Jun 21  2021 lib -> usr/lib
lrwxrwxrwx.   1 root          7 Jun 21  2021 bin -> usr/bin
drwxr-xr-x.  13 root        158 Jul 29  2022 usr
drwxr-xr-x.  21 root       4096 Jul 29  2022 var
dr-xr-xr-x.   5 root       4096 Jul 29  2022 boot
-rw-r--r--.   1 root  269906835 Aug 16  2022 rpm
-rw-r--r--.   1 root         32 Feb  1  2023 tmpconfig_3658661.sh
-rw-r--r--.   1 root         61 Feb  1  2023 tmpconfig_3658921.sh
-rw-rw-rw-.   1 root          0 Feb 27  2023 oom
-rw-r--r--.   1 root        142 Mar 24 15:00 Installer.sh.24032023-150059.log
-rw-r--r--.   1 root        142 Mar 24 15:05 Installer.sh.24032023-150542.log
-rw-r--r--.   1 root        142 Mar 24 15:07 Installer.sh.24032023-150743.log
-rw-r--r--.   1 root        457 Mar 24 15:09 Installer.sh.24032023-150957.log
-rw-r--r--.   1 root  658422784 Jun  6 16:12 datacollection-alerts_1.0.0-SNAPSHOT.tar
-rw-r--r--.   1 root         47 Jun 27 19:11 devnull
drwxr-xr-x.  11 appsone  4096 Aug 29 12:42 opt
dr-xr-xr-x. 297 root          0 Sep  8 15:56 proc
dr-xr-xr-x.  13 root          0 Sep  8 15:56 sys
drwxr-xr-x.  19 root       3100 Sep  8 15:57 dev
drwxr-xr-x.  40 root       1220 Sep  8 15:57 run
drwxr-xr-x.  11 root       4096 Sep 11 18:03 home
dr-xr-x---.  27 root       4096 Sep 14 20:43 root
drwxr-xr-x. 126 root       8192 Sep 19 11:50 etc
drwxrwxrwt.   5 root        116 Sep 19 12:09 tmp

The folder is removed.

List all the content inside a directory or file#

ll

Expected Output:

total 906640
lrwxrwxrwx.   1 root          7 Jun 21  2021 bin -> usr/bin
dr-xr-xr-x.   5 root       4096 Jul 29  2022 boot
-rw-r--r--.   1 root  658422784 Jun  6 16:12 datacollection-alerts_1.0.0-
SNAPSHOT.tar
drwxr-xr-x.  19 root       3100 Sep  8 15:57 dev
-rw-r--r--.   1 root         47 Jun 27 19:11 devnull
drwxr-xr-x. 126 root       8192 Sep 19 11:50 etc
drwxr-xr-x.  11 root       4096 Sep 11 18:03 home
-rw-r--r--.   1 root        142 Mar 24 15:00 Installer.sh.24032023-150059.log
-rw-r--r--.   1 root        142 Mar 24 15:05 Installer.sh.24032023-150542.log
-rw-r--r--.   1 root        142 Mar 24 15:07 Installer.sh.24032023-150743.log
-rw-r--r--.   1 root        457 Mar 24 15:09 Installer.sh.24032023-150957.log
lrwxrwxrwx.   1 root          7 Jun 21  2021 lib -> usr/lib
lrwxrwxrwx.   1 root          9 Jun 21  2021 lib64 -> usr/lib64
drwxr-xr-x.   2 root          6 Jun 21  2021 media
drwxr-xr-x.   2 root          6 Jun 21  2021 mnt
-rw-rw-rw-.   1 root          0 Feb 27  2023 oom
drwxr-xr-x.  11 appsone  4096 Aug 29 12:42 opt
dr-xr-xr-x. 299 root          0 Sep  8 15:56 proc
dr-xr-x---.  27 root       4096 Sep 14 20:43 root
-rw-r--r--.   1 root  269906835 Aug 16  2022 rpm
drwxr-xr-x.  40 root       1220 Sep  8 15:57 run
lrwxrwxrwx.   1 root          8 Jun 21  2021 sbin -> usr/sbin
drwxr-xr-x.   2 root          6 Jun 21  2021 srv
dr-xr-xr-x.  13 root          0 Sep  8 15:56 sys
drwxrwxrwt.   5 root        116 Sep 19 08:19 tmp
-rw-r--r--.   1 root         32 Feb  1  2023 tmpconfig_3658661.sh
-rw-r--r--.   1 root         61 Feb  1  2023 tmpconfig_3658921.sh
drwxr-xr-x.  13 root        158 Jul 29  2022 usr
drwxr-xr-x.  21 root       4096 Jul 29  2022 var

Manual page for specific command#

man <command>

For Example:

man ls

Expected Output:

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 specified.
       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
              with -l, print the author of each file
       -b, --escape
              print C-style escapes for nongraphic characters
       --block-size=SIZE
              with -l, scale sizes by SIZE when printing them; e.g., '--block-size=M'; see
              SIZE format below
       -B, --ignore-backups
              do not list implied entries ending with ~
       -c     with -lt: sort by, and show, ctime (time of last modification of file
              status information); with -l: show ctime and sort by name; otherwise: sort by
              ctime, newest first
       -C     list entries by columns
       --color[=WHEN]
              colorize the output; WHEN can be 'always' (default if omitted), 'auto', or
              'never'; more info below
       -d, --directory
              list directories themselves, not their contents

Availability and the location of the telnet#

which telnet

Expected Output:

  • If the telnet is present in the server, the output is as below with the location:
/usr/bin/telnet
  • If the telnet is not present in the server, the output is as below:
/usr/bin/which: no telnet in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

Next