3 Basic Commands and Simple Shell Scripts Once you have your first Red Hat Enterprise Linux rhel



Download 1.85 Mb.
View original pdf
Page10/67
Date26.02.2024
Size1.85 Mb.
#63678
1   ...   6   7   8   9   10   11   12   13   ...   67
Pablo Iranzo Gómez, Pedro Ibáñez Requena, Miguel Pérez Colino, Scott McCarty - Red Hat Enterprise Linux 9 Administration-Packt Publishing (2022) -chap 3 82 - 180
[user@rhel-instance
]$ pwd

/home/user

Basic Commands and Simple Shell Scripts
72
Some shortcuts for directories include the following
: This is the home of the current user .: This is the current directory ..: This is the parent directory -: This is the directory used previously.
More details on managing files and directories in Linux and RHEL are available in the Listing, creating, copying, and moving files, directories, links, and hard links section.
Bash auto-complete
Shortcuts area faster way to reach commonly used directories or relative references to the current working directory. However, bash includes some capabilities to reach other directories in a fast way, which is called auto-completion. It relies on the Tab key (the one with two opposing arrows at the very left of your keyboard, right above Caps Lock).
When reaching a folder or a file, we can hit Tab to complete its name. For example, if we want to go to the /etc/NetworkManager folder, we type the following:
[user@rhel-instance
]$ cd /et

Then, when we hit the Tab key, this will auto-complete it to etc, even adding the final forward slash (/), as it is a directory:
[user@rhel-instance
]$ cd /etc/

Now, we type in the first letter of the directory we want to go to, NetworkManager, which is N:
[user@rhel-instance
]$ cd /etc/N

Then, when we hit the Tab key, this will auto-complete it to /etc/NetworkManager/:
[user@rhel-instance
]# cd /etc/NetworkManager/

Now, we can hit Enter and go there.
If we press Tab + Tab (pressing Tab twice during complete, this will show a list of available targets to complete – for example, seethe following:
[user@rhel-instance
]# cd /r

root/ run

Using the command line, environment variables, and navigating through the filesystem
73
It can also be used to complete commands. We can type a letter, for example, h, hit Tab + Tab, and this will show all the commands starting with h:

Download 1.85 Mb.

Share with your friends:
1   ...   6   7   8   9   10   11   12   13   ...   67




The database is protected by copyright ©ininet.org 2024
send message

    Main page