List Of One User Command

Every time I use the LAST command all users come to my screen, and if I try Date command, only the day, month and time come out. I'm just trying to list my last logins, where can I find a website that helps me with "how to see the day, month and time for a single user?


Similar Content



Linux Pro's And Noobs! A Challenge, Please Take A Crack At This! (TIME SENSATIVE,)

Do it like this is your situation, your server, and the dir that are mentioned below, act like they are yours! im just looking for an accurate answer!
(student of O'Rielly School of Tech)


whenever you log in, your shell executes commands that it finds in your dotfiles, specifically .bash_login. In your .bash_login, add a series of commands that will first create a directory named ~/sysadmin1/my_peeps/$DATE, where $DATE is today's date in the format mmddyy. This command should succeed whether or not the directory ~/sysadmin1/my_peeps already exists. Then, it will redirect the output of the w command (which lists the currently logged in users on the system) to a file inside this newly created directory called users.$TIME, where $TIME is the current time in the format hhmmss (use 24 hour time).

In order to do this, you must use a new concept: assignment of a variable from the output of a command. For example, in order to set the variable EXAMPLEDATE using the unformatted output of the date command, you would do the following:

EXAMPLEDATE=`date`

The characters surrounding the date command are called "backticks." They are usually located on the same key as ~. They are not single quotation marks. This is actually another kind of expansion called "Command Substitution" (you can learn more in bash's manpage).

For this project, you can use the date command to get both the date and the current time, however, you will have to consult date's manpage to find out how to change the formatting.

Perplexing Cron Audio Problem

I'm running LinuxLite 2.0 32bit on a Dell 3000.

I have never come across anything like this and to tell you, I am stumped.

Here are the contents of my crontab file:

Code:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
*/10 * * * * /usr/bin/arecord -t wav -f cd -d 42 /home/randy/Music/lanting$(date "+\%^b\%d\%y").wav


If I run this from the terminal, everything is fine. It properly records the audio:

Code:
/usr/bin/arecord -t wav -f cd -d 42 /home/randy/Music/lanting$(date "+\%^b\%d\%y").wav

If I run this as it is shown in my crontab file, it records but there is no audio recorded.:


Code:
*/10 * * * * /usr/bin/arecord -t wav -f cd -d 42 /home/randy/Music/lanting$(date "+\%^b\%d\%y").wav

What could be causing this? I tried different cron settings for example 15 14 * * 2

This recorded at 2:15pm on Tuesday (today) but no audio. Yet if I run the code as mentioned above, from the terminal without the cron settings, the recording is fine.

Any ideas what I should do?

User Permitted To Run Command,execute Program As Root And After Execution, Exit Root

when a command is typed(i.e. /path/to/the/program), as a normal user, he should be able to run that command , execute that program as ROOT and log out root after the execution is completed.
Only one user should be able to do it.
Hence, I have created a new user vj and added the following command in visudo:
Code:
vj ALL=(ALL) NOPASSWD: /path/to/the/program

Now user vj will be able to typein the command.

What I need is that the program which is been called must run as if it is run by a root user,and when the program is completely executed, exit the root user.

How do I proceed?

Zenity Radiolist Parameters In Variables

Note: Ubuntu 14 latest release

I am a highly experienced unix user with many years of experience. However, I retired 13 years ago so I can't remember some simple things so forgive me for posting here.

I am trying to use the "zenity --list --radiolist" command. Now this requires that the list of items be last and be of the form FALSE <item name> as in FALSE "Choice 1" FALSE "Choice 2" That's easy without variables. It would be zenity --list --radiolist [other options here] FALSE "Choice 1" FALSE "Choice 2 Works fine.

But what I have is a list of choices in an array. Each of these is a string of multiple words and I have tried (nearly?) everything using echo command piped into zenity (supposed to work) to including an array element in the line with all sorts of quotes, single quotes, escaping quotes, etc. I have even included the "FALSE" in the variable so as not to have to generate it. Nothing works. When using the set -x, it shows that the shell has put a single quote around each word which makes each word a separate parameter.

I have searched all sorts of examples of zenity but the requirement for the word "FALSE" between each item while using variables is never shown.

If anyone has a working example of something like this (or any simple alternative:
JTemp[3]="This is a string"
echo "FALSE "${Jtemp[3]} | zenity --list --radiolist --text "Select Topic" --column "Topic" --column "Pick one" which should display a radiobox with one entry, I would appreciate it. I could then expand it to include all the array elements.

I know I am doing something simple wrong. I just can't figure it out.

Note that I am writing this on a windows machine and using a non-internet-connected linux machine for my work so if I typed the command line wrong, it may be a problem here and not on the real machine.

Thanks for any help.

Script

user="john bob randy susan"
I extracted local user list as: cat /etc/passwd | cut -d ":" -f1

Now I need to write a script to find the difference in user between these two (users defined as above and local user). I tried many ways its not working. Any help

#!/bin/bash
users="john bob randy susan"
luser=`/bin/cat /etc/passwd | cut -d ":" -f1`
......
....


Thank you

W Command Certain Columns

I am looking to display the w (who) command to show only the

User TTY IDLE


http://screencast.com/t/vXb74kguJ

13:15:38 up 8 days, 16:48, 47 users, load average: 1.47, 0.95, 0.51
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
rf3 pts/0 192.168.11.72 05:58 48.00s 6.60s 0.00s -bash
user21 pts/1 192.168.21.177 04:32 8:41m 0.05s 0.00s -bash
user7 pts/2 192.168.11.114 17Mar15 6days 1.07s 0.00s -bash
user7 pts/3 192.168.11.114 20Mar15 4:54m 9.75s 0.00s -bash
user6 pts/4 192.168.11.85 11:02 7.00s 55.58s 0.01s -bash
user14 pts/5 192.168.11.183 05:06 29:08 2.80s 0.01s -bash
user14 pts/6 192.168.11.155 05:30 13:28 2.75s 0.00s -bash
user23 pts/7 192.168.11.62 05:48 25:09 0.95s 0.00s -bash
rf5 pts/8 192.168.11.118 05:58 6:51 5.30s 0.01s -bash
user2 pts/9 192.168.11.140 08:34 1:19 44.74s 0.00s -bash
user14 pts/10 192.168.11.141 06:02 12:14 9.46s 0.00s -bash
rf12 pts/12 192.168.11.69 06:02 2:07 9.44s 0.00s -bash
root pts/13 localhost.locald 12:29 9:10 0.05s 0.05s -bash
rf6 pts/14 192.168.11.79 06:04 14.00s 9.05s 0.00s -bash
user14 pts/15 192.168.21.113 06:23 11:29 1.71s 0.00s -bash
user5 pts/16 192.168.11.126 06:24 6:56 4.59s 0.00s -bash
user5 pts/17 192.168.11.126 06:25 6:19 31.59s 0.01s -bash
user11 pts/18 192.168.11.125 06:26 28:10 2.90s 0.01s -bash
user12 pts/19 192.168.21.123 06:35 13:16 0.88s 0.00s -bash
rf7 pts/20 192.168.11.80 06:35 2:06 7.64s 0.00s -bash
user12 pts/21 192.168.21.123 06:36 41:55 0.12s 0.00s -bash



So far I have this

w | awk {'printf ("6s\ts\n", $1, $2, $3, $5)'} |more
13:20:16 up
USER TTY
rf3 pts/0
user21 pts/1
user7 pts/2
user7 pts/3
user6 pts/4
user14 pts/5
user14 pts/6
user23 pts/7
rf5 pts/8
user2 pts/9
user14 pts/10
rf12 pts/12
root pts/13
This only shows the 2 columns



w |awk '{print $1, $2, $3, $5}'

13:21:01 up 8 16:53,
USER TTY FROM IDLE
rf3 pts/0 192.168.11.72 20.00s
user21 pts/1 192.168.21.177 8:46m
user7 pts/2 192.168.11.114 6days
user7 pts/3 192.168.11.114 4:59m
user6 pts/4 192.168.11.85 3:42
user14 pts/5 192.168.11.183 34:31
user14 pts/6 192.168.11.155 18:51
user23 pts/7 192.168.11.62 30:32
rf5 pts/8 192.168.11.118 12:14
user2 pts/9 192.168.11.140 1.00s
user14 pts/10 192.168.11.141 17:37
rf12 pts/12 192.168.11.69 30.00s
This shows some what hard to read and the columns don't line up correctly


is there a way to tab them in to columns that line up properly, or even something similar to the TOP command where the list will keep refreshing?

Slackware 14.1/adduser Command/session Files

Hello All,

Under root we create a user named "template" using the adduser command which is used to setup a kde GUI logon screen for all users. When a user's name is initially used to sign on we get a window on the GUI that states "Run as Template. The action you requested needs additional privileges. Please enter password for template." (Note: No password for template is used.) There are four files that have been observed:
/usr/bin/hp-systray-session (followed by numbers)
/usr/bin/akonadi_agent_launcher-session (follwed by numbers)
/usr/bin/khelpcenter-session (followed by numbers)
/usr/bin/nepomukcontroller-session (followed by numbers).

When we logout then log back in,this window does not appear again on the GUI.

Any help for this one?

Thanks.

Regards,

Jeff

About Mysql Show Processlist

I have connected to mysql console by "mysql -uroot -p" , then use the command "show processlist ;" to list the processes , but I can't see the result , may be the command is too long , the column only allow around 85 characters , the command should over the limit , how can I see the full command ?

thanks

Time Sync Problem Between VirtualBox And Host System

hello all,
i actually am new to using VirtualBox, so am not aware with much of its functionalities.

my problem here is that when i take a snapshot at say 10am , and then restore that snapshot an hour later at 11am and then start the VM then the time in the host system is 11am but the VM shows the time as 10am and continues from there itself.. i tried waiting for some time to see if it would sync the time automatically, but it didnt.

so is there any command using which i can sync the time between the VM and host system?

i have searched and found that VM GuestAdditions helps to sync the time instantly within 10 sec or so.. but i dont want to use it because i have heard that many problems have occured after installing the GuestAdditions..

so without GuestAdditions is there any command to sync the time?

thankyou to all in advance

Display Last Month

I know the command many display current month and year .

Code:
#date +%b%Y

Jun2015

If I want to show the last month and year ( as current month is Jun2015, I would like display May2015 , if current is Jan2016 , then display Dec2015 ) , would advise what can I do ? thanks