I work under centos 5, I would like to know which command to use in order to find where the useradd command is geinstalled. Second How can I find the 10 last files sorted (reverse) from the /etc directory.
I am bulding my own image based on 2.6.32 kernel, I wish to add a guest user:
In a script thats invoked by the makefile, I use 'useradd' command & this updates the shadow, passwd files under /etc on the host, is it possible to tell the command to create the shadow / password under some other folder on the host? may be /tmp?
I am trying to learn shell scripting from a book and all I am doing is following few instruction from the book. Now this is what I am doing. I am trying to add a user using the useradd command so I run the following at command prompt root@S8500C_9>useradd ajit. The first time when I add this user I was successful.Later I deleted this suer using the userdel -r ajit command.Now when again I am trying to add this user it gives me following error. useradd: group ajit exists - if you want to add this user to that group, use -g. Now when I try using the -g option with the useradd command it gives we all the set off options avaiable to use along with the useradd command but doesnt create the ajit use
when i see /usr/bin there is no useradd command. and i want to add a user.if i type the command it is shooting an error saying command nt found .how should i create a user.
I'm trying to make a shell script that will list the 50 newest files in a directory with several subdirectories in. I've been trying with the find-command with no luck and now I've figured I should probably use ls. The problem is when I do "ls -lRt | head -50" it will do 1 directory at the time. It will not first make the full list and then sort it. This will display all items in first directory, sorted, then the newest directory will be sorted and displayed. So I figured I have to sort the whole process of ls before I limit the head. So this is where I am at now: ls -lRt | sort <something clever here> | head -50
Only doing a "|sort|" will sort it by name if I understand it right and I don't know how to solve it. Here's also my first attempt if that is of any interrest or help, this was limited by the change status time of files (so some lists got very large). These lists dit not get sorted by time and I could not find any way to do so.find $ftpDir -ctime $time -type f -print > $ftpFileLsAny help on this would be appreciated since I'm sort of stuck now. After reading manuals for all the options I can think of and still there's just a big blur in my head..
I encountered a question in the Redhat Skills Assessment regarding useradd: Which of the following cannot be defined when you create a user account with useradd? a* A password expiration date. b* The user's primary group. c* The user's default shell. d* The user's NIS or LDAP group. e* The user's home directory. Which is the correct answer? I have my own thinking which will be explained later.
Im not getting able to neither add new users using command useradd nor delete existing users using command userdel. And even Im not getting able to login into any existing users except root. It was ok before. Im having this problem very recently on my linux server. Im using RHEL5.
I want to create one user without password using useradd command. Is there any way we can do the same? I have googled it but couldn't get the perfect solution
Ive been using linux for a while but I am just getting into shell scripting, im currently trying to get a simple script for finding and copying files powered by the command:
Code:
This works fine from the command line but when put in a script such as:
Code:
Code:
with the keyboard inputs for $fc1 and $fc2 being *.doc and ~/test respectivly. The only problem i can see is the xargs -ivar "var" part possibly needing $var to be defined?
I want to be able to use Ctrl+R to have reverse-i search. Also if I press Shift+Up Arrow after typing the first few characters of a recently executed command then the shell should complete the command by finding the most recent commmand having the same first few characters.
Where exactly are the temporary files stored, in /tmp or /var/tmp. How can i remove temporary files through command line? What is the difference between these two directories?
Is there a program for Ubuntu that converts AVI files to VOB files? This is the only type of file that will burn to a DVD and successfully play on my DVD player. I can use DVD Flick on Windows but I'm sure this can't be the only way. There has to be a way to get VOB files on an Ubuntu operating system.
I'm trying (well aiming) to customize my desktop so that on login Terminator is on workspace 3 (split 3 ways and running lynx, irssi and top. I'm using gdevilspie to configure it but I understand and can use the normal config files. When I use gdevilspie to make a terminal background it works but when i try to do stuff with terminator it doesn't.
Here's my terminator config so far: Code: ( if ( begin ( is ( window_class ) "terminator" ) ) ( begin ( undecorate ) ( spawn_sync "top" ) ( set_workspace 3 ) ( maximize_horizontally ) ( center ) ( below ) ( set_viewport 3 ) ( println "match" ) ) )
Once I do get devilspie sorted I also want to make Terminator automatically split and run the correct commands.
I know "rpm -qa --last" lists all rpm with date and time. But I want to sort the list by date, with earlier installed rpms displayed ahead. So it needs pipe, ie something like "rpm -qa --last | ...". What is exact script to do it?
I frequently receive e-mail from mailing lists in which I would like to stay active in, although when I access my e-mail I'd like to be able to have the unimportant e-mails in their specific IMAP-folders so I can read them later when I have time.
There is one very important requirement. It bugs me that people continuously keep advising me poor solutions that involve forwarding e-mail e.g. to blabla-mailinglist@domein.tld or storing the e-mail locally. I work frequently from different locations, use different e-mail accounts and see e-mail stored on the server rather than on my local machine as a great advantage.c.
I was thinking of preferably a simple solution that works via a cronjob to do sorting, so it will also work for Plesk and Gmail IMAP accounts. Sorting based on from/to/subject should be sufficient.
I wanted to read out the absolute file-path (filename) as sorted in a folder (on Linux). The reading the file-paths is ok but I have problems in sorting.
Code:
selectedDirectory = fl_dir_chooser ("Select Imagedirectory:",NULL,0); //This is just a widget to show the folder. DIR *d; dirent *de;
[code]....
The files -105.dcm, -106.dcm, -107.dcm lie in the folder at the bottom and -36.dcm, -37.dcm- at the top. The program compares 1 and 3 of 105 and 37, 1 is lesser than 3, then prints out first, but does not know that 105 is three digits and 37 is two digits.
I'm looking for a way to get my IP address using the command prompt in Linux. I know when you type "ifconfig" you can get your local IP address (i.e. 192.168.0.103), but I'm looking for my IP address that I get from my ISP. How can I get this from Linux without having to visit some website?
My professor is making us do a few c++ projects only with the command line. What do you guys recommend? Ive heard editors such as nano, vim, and emacs.
I have a many process running in my machine with similar command and the command is 'gzip'. It is running by a program in a file. How will I find out the file which is behind this command.
when i send any packet to anu destination and want to see he mac address of source and destination i am using the command tcpdump -qec1 but rather then getting the mac address of source and destination each time i am getting mac address of the system which is broadcasting. will anybody tell me how can i get source and destination mac address even if any other packet is also being broadcast to my network.
Whenever I install Fedora other distros don't show up in GRUB. Windows shows up in "other," and I can see the other distro still intact when I run G Parted, but I don't know how to get it to show up in GRUB. Is there a terminal-command in F14 that probes other OS's on the hard drive and restores them to GRUB?