Please explain the usage of ampersand in the following command
What I understand is that ampersand is used to run some process in the background. And, what I am expecting from this command is
"Output of who should be displayed on the screen with value of total number of users who have logged in displayed at the bottom of the list."
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Hi,
I have this line in a script:
if mt -f /dev/nst0 rewind > /tmp/status_nst0.log 2>&1 ; then
What does the 2>&1 mean? I think the line is saying that after rewinding the device if the log file does not exist then execute the code but I do not understand the contribution of the 2>&1.... (2 Replies)
Hi,
By using time command we can determine the execution time of a process or command.
bash-2.04$ time ls -l
total 0
-rw-r--r-- 1 admin tac 0 Oct 6 04:46 file1
-rw-r--r-- 1 admin tac 0 Oct 6 04:46 file2
real 0m0.002s
user 0m0.000s
sys 0m0.001s... (5 Replies)
Hi,
17 11 * * * /xx/yy/name.sh >> /tmp/cron.log 2>&1
The above statement is one of the crontab entries.
The crong log is getting appended everytime. Can anyone tell me the usage of "2>&1"?
Thanks. (2 Replies)
Hi all,
Can you please tell me the command, with which one can know the amount of space a specific directory has used.
df -k . ---> Displays, the amount of space allocated, and used for a directory.
du -k <dir name> - gives me the memory used of all the files inside <dir>
But i... (2 Replies)
In the terminal, using the ampersand allows the process to run in the background--Emacs, for example. But is there a way to automatically open Emacs as a background process so I can still use the command line? Typing the ampersand is just annoying to me, and I keep forgetting; it's just too useful... (0 Replies)
I have the following line of code that works wonders. I just don't completely understand it as I am just starting to learn regex. Can you help me understand exactly what is happening here?
find . -type f | grep -v '^\.$' | sed 's!\.\/!!' (4 Replies)
Hi all,
Been reading a lot of the cpu load and its "analogy of it to car traffic path of expressway"
From wiki
Most UNIX systems count only processes in the running (on CPU) or runnable (waiting for CPU) states. However, Linux also includes processes in uninterruptible sleep states... (13 Replies)
Hello everybody,
I have a Problem with sed command.
I want to replace a defined string with a string from a database field (dynamic).
e.g.
sed -i -e 's/%NAME%/'"$HNAME"'/g'
The Problem is that the $HNAME variable can contain Special characters like '&'
e.g.
HNAME="AH Kruger & Co. KG"
... (1 Reply)
For years I have spawned shell scripts with nohup and ampersand and they run whether or not I stay logged in. Recently a client told us that we had to set a keep alive timeout on all of our Redhat 7.6 Linux servers. Our sysadmin set the following parameters in the sshd_config file on all of our... (10 Replies)
Discussion started by: gandolf989
10 Replies
LEARN ABOUT LINUX
lastlog
LASTLOG(8) System Management Commands LASTLOG(8)NAME
lastlog - reports the most recent login of all users or of a given user
SYNOPSIS
lastlog [options]
DESCRIPTION
lastlog formats and prints the contents of the last login log /var/log/lastlog file. The login-name, port, and last login time will be
printed. The default (no flags) causes lastlog entries to be printed, sorted by their order in /etc/passwd.
OPTIONS
The options which apply to the lastlog command are:
-b, --before DAYS
Print only lastlog records older than DAYS.
-h, --help
Display help message and exit.
-t, --time DAYS
Print the lastlog records more recent than DAYS.
-u, --user LOGIN|RANGE
Print the lastlog record of the specified user(s).
The users can be specified by a login name, a numerical user ID, or a RANGE of users. This RANGE of users can be specified with a min
and max values (UID_MIN-UID_MAX), a max value (-UID_MAX), or a min value (UID_MIN-).
If the user has never logged in the message ** Never logged in** will be displayed instead of the port and time.
Only the entries for the current users of the system will be displayed. Other entries may exist for users that were deleted previously.
NOTE
The lastlog file is a database which contains info on the last login of each user. You should not rotate it. It is a sparse file, so its
size on the disk is usually much smaller than the one shown by "ls -l" (which can indicate a really big file if you have in passwd users
with a high UID). You can display its real size with "ls -s".
FILES
/var/log/lastlog
Database times of previous user logins.
CAVEATS
Large gaps in UID numbers will cause the lastlog program to run longer with no output to the screen (i.e. if in lastlog database there is
no entries for users with UID between 170 and 800 lastlog will appear to hang as it processes entries with UIDs 171-799).
System Management Commands 06/24/2011 LASTLOG(8)