Questions tagged [shell]

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion.

Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

The name was first used by Unix operating system for an interpreter used for command prompt, but currently the term shell refers to BASH(Bourne Again SHell) and other command prompt interpreters too.

1348 questions
-1
votes
2 answers

How to monitor user reports through shell scripting

I want to monitor I have 3 user in my linux machine let's say a,b,c .By Using last command I am able to identify list of last logged in user and by w command who is logged in and what they are doing and by history command all command used by…
-1
votes
2 answers

Availability of file for each user directory on bash

I have an idea, how to check availability of "id_rsa.pub" for each user in home directory. But something does not work. My script: #!/bin/bash users=`ls /home/` for i in "$users"; do if [[ -f "/home/$i/.ssh/id_rsa.pub" ]]; then echo "All…
Piduna
  • 1
  • 3
-1
votes
2 answers

Uniq by two columns with two conditions

i have table with columns. In first column, i have time, when the user has logged, in second column, i have a name of user. 13:15:39 fxs1cia1qulm1lk 13:15:39 fxs1cia1qulm1lk 13:15:39 fxs1cia1qulm1lk 13:15:42 faaaa2aa11111 13:15:49 …
Valeriu
  • 57
  • 2
  • 9
-1
votes
1 answer

How to run or integrate Shell scripts in Chef

I have developed many automation solutions as shell scripts and it has been successfully being used in Prod/Dev environments. With Chef being introduced, I need to start using Chef as a future automation solution. As a First Step, I am trying to…
CoolChap007
  • 13
  • 1
  • 3
-1
votes
2 answers

Catch an error at nginx reload

I have a bash script that's make some operation on nginx's virtualhosts. I would like to know how to catch error if nginx not reloading correctly (nginx reload). I think to use nginx -t but i don't know to intercept error in a bash script.
Davide
  • 101
  • 2
-1
votes
1 answer

How to use the awk,sed Modify the text?

As follows, some text 16G 16G 1.9G 40G 4G 4G 952M 60G 16G 16G 1.6G 40G 5G 780M 5G 80G I want to change all the unit from 'M' to 'G', like this 16G 16G 1.9G 40G 4G 4G 0.92G 60G 16G 16G …
jython.li
  • 84
  • 2
  • 10
-1
votes
2 answers

shell script to open many terminals from a parent terminal and execute different cmds

I want to open 5 terminals from a parent terminal and place these terminals on the screen properly so that each terminal can be viewed properly at the same time. Also, i want to execute differnet commands in each terminal. Can you help me…
pawan
  • 1
  • 1
-1
votes
1 answer

Using rsync with StrictHostKeyChecking and find files older than 5 minutes from remote

I would like to use rsync to sync my files from remote to a local directory. Therefor I use StrictHostKeyChecking so that there's no need to enter a password. Now I would like to only sync files older than 5 minutes. I thought to use find…
mediii
  • 3
  • 2
-1
votes
1 answer

understanding the result of this bash script

I have this simple bash script #!/bin/bash -x for line in `tail /home/user/line` do echo $line done but dont know why it echos all words instead of each line below is output ++ tail /home/user/line + for line in '`tail /home/user/line`' +…
grant tailor
  • 505
  • 2
  • 6
  • 13
-1
votes
1 answer

Login by ssh , change the remote PS1 and don't quit the remote ssh shell

I want to change PS1 when i ssh another centos strshell = 'PS1="remote!"' os.system("ssh -i %s -l%s -p%s %s %s"%(SSH_KEY,SSH_USER,SSH_PORT,des,strshell)) ssh quit automatically. I want to stay in this shell.How to achieve it. I just…
-1
votes
1 answer

Crontab not working to send email

I have CentOs 6.5 running on a VPS Host. I installed crontab and email using the below commands yum install vixie-cron service start crond chkconfig crond --levels 235 on yum install sendmail service start sendmail chkconfig sendmail --levels 235…
robue-a7119895
  • 167
  • 1
  • 8
-1
votes
1 answer

How to access a system with write permission after file system check fails?

I created three new partitions, but after a reboot, the system is being dropped to a shell: /dev/mapper/group-newpartition: clean, 11/655360 files, 276620/2621440 blocks [FAILED] An error occurred during the file system check. Dropping you to a…
Purres
  • 239
  • 1
  • 4
  • 18
-1
votes
2 answers

can't find the executable for the command linux 'source'

i am using ubuntu server 12.04 lts. I am looking for the executable of the linux command source i can not find in the /bin nor /usr/bin nor /usr/sbin nor /usr/local/bin . I used whereis source it gives me source: but i need the path for this…
ghassen
  • 123
  • 1
  • 6
-1
votes
3 answers

What is default shell for users in /etc/passwd for Solaris 11?

For a Solaris 11 Server Config Review that I am doing, I have following lines in my /etc/passwd file: root:x:0:0:Super-User:/root:/usr/bin/bash daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: adm:x:4:4:Admin:/var/adm: lp:x:71:8:Line Printer…
Nirav Zaveri
  • 103
  • 1
  • 5
-1
votes
2 answers

Setting IPtables rules into a file

Currently I have a debian install with a shell script which has the following content (as an example): # Setup iptables IPT="/sbin/iptables" # Flush old rules, old custom tables $IPT --flush $IPT --delete-chain # Set default policies for all three…
Jimmy
  • 269
  • 4
  • 7
  • 23