newbie: misc commands - id, groups, uptime, uname, date, cal, whoami date: 08.4.99 Misc. commands, lesson one. The following utilties provide basic information about the system or other day to day functions. For the most part, they are simple to use, allow few arguments, and only report a specific bit of information back.
command: id This shows your User ID (UID) and Group ID (GID) [as set in /etc/passwd], as well as all of the groups you are in [set in /etc/groups]. Unix does all access based off three categories [covered in 'chmod' lesson]; user, group, other. Your UID and GID dictate exactly what kind of file and permission access you have around the system. The other utility that quickly shows the groups you are in is groups. Knowing which groups you are in helps you figure out what kind of file or directory access you have beyond your own files. forced ~$ id uid=1000(jericho) gid=17(hide) groups=10(wheel),100(users),101(compiler),102(locate),105(socket),106(shell) forced ~$ groups hide root bin wheel users compiler locate socket shell irc malvu forced ~$
command: uptime Uptime tells you how long the system has been up and running since the last reboot, how many users are currently logged in, and the load average of the machine. The load average gives a numeric representation of how much of the CPU is being utilized. forced ~$ uptime 11:48pm up 7 days, 14:29, 4 users, load average: 0.11, 0.13, 0.09 forced ~$
command: uname The uname command shows various information about the system you are on. Included in the uname output is the Operating System, machine name, OS version, and architecture. By itself, the uname command will only tell you the Operating System. It is advised that anytime you run the command, you do so with the -a argument for full information output. A Slackware Linux machine: forced ~$ uname -a Linux forced 2.0.37 #2 Mon Jul 19 16:47:13 MDT 1999 i586 unknown forced ~$ A modified Linux machine: forced ~$ uname -a ATTRITION forced 0.0.1 #23 Fri Oct 30 03:52:30 MST 1998 i586 unknown forced ~$ A Sun Microsystem's SunOS machine: flatland ~$ uname -a SunOS flatland 4.1.4 3 sun4m flatland ~$
command: date Gives you the current system date and time. Be careful, if you are acessing a system across the nation, pay attention to the time zone ;) forced ~$ date Thu Nov 26 23:51:55 MST 1998 forced ~$
command: cal cal is short for 'Calendar' and does exactly that. When run by itself, it displays the current month's calendar. forced ~$ cal November 1998 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Calendar is great for displaying more than the current month. When given the arguments, it will display month and year as desired. syntax: cal (mo) (year) forced ~$ cal 12 1998 December 1998 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 forced ~$
command: whoami Believe it or not, when bouncing around systems or maintenance accounts, you might not remember who you are logged in as. So ask the system 'who am i'! forced ~$ whoami jericho forced ~$
email@example.com (c) copyright 1998, 1999 Brian Martin