Just deleted tons of stale, unsused user accounts. Here are some KSH shell basics and special shell variable. I need to Google them up myself to get reminded that ‘$?’ is the output variable for script execution. That is, it’s 0 for successful execution and 1 if there is any error.
Category: Commands
Veritas Volume Manager VxVM Basics Commands Cheats.. The authority site for this topic, the VXVM on VXFS, if you do a Google search for any tutorial or command cheat sheet is Cuddletech.
I want to post… say, borrowing, the content of that page to this post for my own personal reference… Love your own page right? And since I am more likely to open SysadminPH that cuddletech, I thought we not copy the Veritas tutorial page here for my ease of access?
Another quikie copy/paste kind of thingy…
You may set your search path automatically each time you log in, by placing the appropriate “set path” command in your “.login” file.
(To learn more about the .login file, type “help dotlogin”.) Here is a sample of a command line that you might put in your .login file to set a non-standard search path:
set path = ( $path /usr/ucb /bin /usr/bin /usr/new .)
Top equivalent for AIX – Topas, Only Better… That’s what I searched when I got a ticket from one of the AIX boxes here complaining about CPU being 99% used up.
Of course, you can use vmstat with interval, but for those sysadmin folks who are use to using Top, its still more comfortable using (and seeing) the top output.
Topas is the equivalent of Top for AIX.. it’s better than Top as a matter of fact according to some AIX gurus (and Solaris)
If you persists in using top, You’ll have to build it yourself from the sources at http://www.unixtop.org/ plus probably this fix:
http://sourceforge.net/tracker/index.php?func=detail&aid=934590&group_id=72892&atid=536044
Good luck!
Do Not Prompt Password for SUDO: NoPasswd, here’s a quikie, quikie post… How do you setup a sudo for a user without prompting the user for his password?
RTFM!
Simply add NOPASSWD before the list of commands…again NOPASSWD goes before the list of commands, after your username and host list. The man page has this example:
ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm
Where ‘ray’ is the username, ‘rushmor’ is the host and the rest, you know already….
pwd is probably the most widely used UNIX (or Unix-like) command! ls (el-es) could also be the most used but we will be talking about pwd here, so let’s say that ‘pwd’ is the most widely used shall we?
What is pwd?
pwd, when executed at the shell (prompt) will print out the current working directory in the standard output of the system, which is the monitor.
pwd could be and abbreviation for ‘print working directory’ or ‘present working directory’ or make up your own definition.. there’s no rule.
WIkipedia says:
In Unix-like and some other operating systems the pwd command (print working directory) is used to output the path of the current working directory.
The command is a shell builtin in certain Unix shells such as sh, and bash. It can be implemented easily with the POSIX C functions getcwd() and/or getwd().
The equivalent on DOS (COMMAND.COM) and Microsoft Windows (cmd.exe) is the “cd” command with no arguments. Windows PowerShell provides the equivalent “Get-Location” cmdlet with the standard aliases “gl” and “pwd”. The OpenVMS equivalent is “show default”.
Example:
$ pwd
/home/foobar
Here’s what we did today on one of our Solaris box that is worth mentioning on this cool super system administrator’s blog ‘o mine! (Don’t you find it cool that SysAds are so funny?!)
Anyhoo, today we re-jumpstarted a laboratory box because the ‘owner’ of it wants it back. Since we pretty much messed it up, I have to jumpstarted a fresh copy.
After installing returned the original /etc/shadow and /etc/passwd back from backup (had a backup file on the laptop).. but unfortunately, the /etc/shadow file is ‘null’.
Restoring File From UFSdump Backup
Here’s the procedure in restoring a particular file from ufs dump backup… Of course if you’re restoring from ufs backup you probably made a ufs backup in the first place, right? Right!
In this example, the files backup.examples and junk are restored from the pubs directory: