General :: Identify The PID Number Of Login Shell?
Oct 12, 2010what are the two ways you can identify the PID nimber of your login shell
View 14 Replieswhat are the two ways you can identify the PID nimber of your login shell
View 14 RepliesI'm looking to get a shell script to loop through a number of directories and subdirectories,looking for files that contain a particular substring, and renaming the file by replacing the search string with a different substring. For example if you had a directory full of folders that contained digital photos (along with various other files which would need to remain unaffected), and the intent was to remove the "DSC_" prefix from several thousand files buried within. I've whipped up a rather long-winded solution that works well for this purpose but chokes on directory names with spaces. I am reasonably sure there's a 2 or 3-liner that would accomplish this exact same task.
function investigate
{
path=$1
for file in `ls $1`
#for file in *
[code]....
I need to find TCSH shell and gzip version number by running a acript on several boxes through ssh. How can i do that? I made a script for tcsh but it is not working by ssh , it only works on my box . I dont know from where to find the gzip version info.
View 5 Replies View Relatedif there's a tab-delimited file under /usr/desktop, how can I determine the number of rows and columns of the file in shell?And, if told the the 3rd column of the file contains only numerical values and all values in the 5th column are unique, how can I verify these in shell?
View 13 Replies View Relatedi want to write shell script that give a number between 1-3444 from user and if user enter out of range number give error e.g number must between
read -p "plz Enter Number " p
while [ $p != [1-9] -o $p != [1-9][0-9] -o $p != [1-3][0-4][0-4][0-4] ]
do
read -p "plz Enter Valid Number" p
done
but this have an error in while statement ! two many argument
I need to write shell script which can take number of files and count total rows from all CSVs and display total number of rows counted in all files. Is there any possibility of doing that using shell script and if yes then how.
View 4 Replies View Relateddiffrence between login and non login shell. What does it mean by user enviorment.
View 3 Replies View RelatedIf I only want to let a user be able to login via telnet a max number of times equal to 2 how would I go about doing this?I have found this little tid bit:per_source = 2but that only allows 2 connections from the same source (i.e. network) and that would not work. For some reason our telnet sessions are not dying off after a user has shutdown their PC and then the next time they login it adds another telnet session.
1. user1 31300 /dev/pts/409
2. user1 27539 /dev/pts/539
3. user1 18042 /dev/pts/316
[code]....
How to get output of text file containing account number, debit amount, credit amount,date using shell script?
View 1 Replies View RelatedHello.I am using Opensuse 11.1 (just installed),gnome-based .My problem is,I can only login as root,cos the tty's attached to my normal user(non-privileged)keep crashing(I checked this with last).Is there any way I can fix this?I reinstalled several times,nothing to do.
View 9 Replies View RelatedHow to login as root in linux shell?
View 3 Replies View RelatedI work with a text mode debian6.0 and when I was testing some commands, I changed default shell to ash. System replied that it has not ash shell.so I thought the shell did not change. But when I start the system again and enter root password, I see a message like "can not execute ash. No such file or directory" and then system return to login page again. Root is the only user on that system.
View 11 Replies View RelatedWhen we are asked for password while booting Linux, is that the login shell ? If yes, we can't seem to be able to do anything in that shell besides typing the password. (Is it in this that the contents of /home/.profile file gets executed ? in a sigle PC)
When we click on the terminal icon for the first time, are we opening a subshell of something or a new shell altogether? If on repeatedly clicking on the terminal icon, new shells are being launched, not sub-shells, then why does export seem to work with the new shells, though its supposed to work for subshells ?
I want to create a script to delete user if he has no login shell.
View 4 Replies View RelatedAny one tell me online bash login using putty [ssh port] for practicing a linux.
View 6 Replies View RelatedI was trying to create a shell script which will automatically login to the server 192.168.1.7 and checks if a user exists there or not, if it doesn't exist then it should create the user.I have very little idea about shell scriptThis is what I tried:Quote:
#!/bin/bash
pass="sacharje"
ssh 192.168.1.7
Now, how to pass that password automatically to the ssh when it asks for the password? (I can't use public key authentication here)
yesterday I updated my fedora 13 to fedora 14 (on laptop) and today i cannot log in on user. It just go blank for a sec and is back to login.
At text console (alt+ctr+f2/f3) i enter my username and pass it give this for a sec and resets (clean) console
username: Name
password:
last used: [date]
login: no shell permission denied
i used unetbootin (fedora 14 netinstall to update) and later i updated 1,5G before reboot (did update that fix, forgot its name tho :s)
I would most likely reinstall everything, but i have some work at laptop and as death-line is near, i would prefer to fix it if possible.
edited:
i have installed F13 on unused space, is there a way for me to access and fix it? or at least get some files from there?
1-Can I have the shell command which allows me to have the number of reques ts/seconds under the Apache server?
2-And the number of sons threads in service/wait?
I am trying to get the count of number of CD-ROMs attached with my Linux system using a bash shell script. I have decided to use the following method for it:
Code:
debian:~# cat /proc/sys/dev/cdrom/info | grep "drive name:"
drive name: sr0 hdb
So basically I know that there are two CD-ROMs attached to the system. Now there can be three also like this:
Code:
debian:~# cat /proc/sys/dev/cdrom/info | grep "drive name:"
drive name: sr0 sr1 hdb
All I want to do is in my shell script to get the count of the devices in a variable using the above command.
I can't think of what would cause this problem. The num lock light is on and I can sign in with the number pad (password is all numbers) but when I get into Ubuntu the number pad stops working with numlock light on or off.
View 4 Replies View RelatedWhy does unix ps -l whows one number in column "PRI" but in same time ps -o pri shows another number? cpu and nice are zero for those processes
View 1 Replies View RelatedI am using the sudo command to log on locally as another user by the following command:
sudo -u theotheruser -s
or
sudo -u theotheruser sh
As I see it, this initiates a new shell with the mentioned other user.However, this doesn't load that users profile from his home directory.Is there a way to automatically read the users profile when login in with selected command? I am mostely interested in getting a working prompt when logged in.
Is there an ssh or sshd parameter that can be set to block out a user after a set number of attempts tp login ?
View 1 Replies View RelatedCode:
cat ${SOURCE}/{start,universal,index,end}.txt > ${SERVER}/index.html
cat ${SOURCE}/{start,universal,02042010,end}.txt > ${SERVER}/02042010.html
[code]....
Are there any identifiers on an HDD that can be either seen physically on a "sticker" on the HDD, and the same number/identifier could be read with software solutions?
I mean if I see with e.g.: S.M.A.R.T. that an HDD (in RAID) is failing, then I give out the command:
SOMEMAGIC
then I get an OUTPUT, e.g.: 9835923759237489
and then are ther any stickers on the HDD that has a label: 9835923759237489 ? so the hdd that has to be changed could be identified.
I have a Red Hat Linux system that does not boot. The boot partition is damaged and files cannot be recovered.
I would like to know how to find out which version of Red Hat was installed from the program/data partition which is undamaged and accessible from Fedora Live CD. I assume this is available in a configuration file somewhere.
On my 64 bit Linux box, i have many processes which are 32 bit and some are 64 bit, how to identify which process is 32 bit and which is 64 bit?
View 2 Replies View RelatedI just 0 & 1'd a pen drive, and now I dont see it in 'blkid' output. Is there a way to know where the device is on the system, so that I can format it with a filesystem?
View 3 Replies View Relatedhow to identify freshly installed linux o/s
View 7 Replies View RelatedI know about syslog and /var/log/* log files but I don't know what kind of events means particular problem.
E.g.
- hardware issues (?)
- security problem (/var/log/security)
[code]....