Recalling another blog this week, 5 CentOS commands for basic troubleshooting for a Windows guy, I had wanted to cover few more UNIX commands. These commands had come in handy recently and in the past.
1. w, for who is logged in to system? Simply type: w
Example of output:
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 garzafx 14:05 0.00s 0.12s 0.00s w
Administering applications requiring UNIX user logons, this command had offered a quick view of the folks being displaced with service restarts or system restarts (i.e. Init 0,1,6 or reboot).
2. man, for help from the manual. If you had needed to get assistance on a command, simply remember, type man followed by what you are looking for! Syntax had followed this example;
man man or man ip a
Example of output:
[root@localhost ~]# man man
man(1) man(1)
NAME
man – format and display the on-line manual pages
SYNOPSIS
man [-acdfFhkKtwW] [–path] [-m system] [-p string] [-C config_file]
[-M pathlist] [-P pager] [-B browser] [-H htmlpager] [-S section_list]
[section] name …
DESCRIPTION
man formats and displays the on-line manual pages. If you specify sec-
tion, man only looks in that section of the manual. name is normally
the name of the manual page, which is typically the name of a command,
function, or file. However, if name contains a slash (/) then man
interprets it as a file specification, so that you can do man ./foo.5
or even man /cd/foo/bar.1.gz.
3. cp, for copying files. With UNIX configuration files of all sorts, this command had provided quick CYA measure worthy of mentioning. The syntax that UNIX had followed:
cp oldfile.txt newfile.txt
4. mv, for renaming files. Some applications had recreated configuration files on restart. Keeping it simple for this scenario, I had suggested a move in one command;
mv oldfile.txt newfile.txt
5. pf -ef | grep –I, for searching system wide. This command had required a lot of exposition maybe; however, in avoiding verbosity and any confusion, I had thought useful mentioning just the syntax. This piped command had come up multiple times in my travels from AIX to CentOS. Years ago, I had witnessed this command shopping for crash dump files (i.e. core files). The most recent occasion had occurred with hunting down NetworkManager service.
Example of output:
[root@localhost network-scripts]# ps -ef | grep -i network
root 1454 1 0 09:34 ? 00:00:00 NetworkManager –pidfile=/var/run/NetworkManager/NetworkManager.pid
If you had remembered other commands worth mentioning, chime in. Hopefully with your next system administrative crisis with UNIX gremlins, this post had provided some guide to navigating the waters of cli.
Read More: