0
votes
2answers
39 views

Is it possible for a root user to watch others' shell session secretly in live?

I see a similar question on stackoverflow: http://stackoverflow.com/questions/1353253/linux-terminal-how-to-capture-or-watch-other-terminal-session Someone recommends conspy. However, it seems that ...
0
votes
1answer
17 views

Bash doesn't source file unless manually started

bash won't source files from an login terminal unless I manually run bash from a terminal, I have bash (and not sh or dash). When I source a file, it returs errors (like "syntax error near unexpected ...
1
vote
2answers
35 views

Execute a previous command in a shell and get the command directly after

Once, a colleague of mine shown me a very useful method (shortcut?) on a shell (bash? csh?) to, after executing a previous command, automatically show the command after in history. For example, ...
-1
votes
1answer
25 views

Using /usr/bin/env to change directory [on hold]

I want to automatically execute commands with the prefix /usr/bin/env $/usr/bin/env composer install (this runs OK) $/usr/bin/env cd public (failed ---> /usr/bin/env: cd: No such file or ...
0
votes
2answers
15 views

Piping Several commands in a BASH shell

I am trying to recursively loop through a directory which contains numerous other directories and files and then find all the .rb files and copy them to another directory. This is what I have so far ...
0
votes
0answers
14 views

is the chromebook developer mode shell a fully capable linux shell

I have enabled developer mode on my chromebook. Is the command line shell a fully implemented linux shell? Would there be any point in installing something like ubuntu?
-1
votes
1answer
22 views

how to escape '$' in an awk statement in shell alias

I'm trying to write an alias that will kill all running php processes.. this is the command i got in my ~/.bash_profile alias killphp="ps aux | g [p]hp | awk '{print $3}' | xargs kill -9" this ...
0
votes
2answers
40 views

change shell of a user from /bin/false to another

I made a mistake of change the root shell to /bin/false, but when I want to change it back, I always got error sudo chsh -s /bin/bash root [sudo] password: <input current user password> ...
0
votes
2answers
21 views

“Less” prompts for “binary file” display when colors in output

We've recently enabled colouring the log files of a few services, I believe we use ANSI escape sequences for that. Looks like this: [2014-06-12 10:56:43,214] [main] [VOID] ESC[34mINFO ESC[0;39m ...
0
votes
0answers
22 views

Run shell script/start Junit test in android without PC/ from SD card

I have a Robotium Test case, which is an instrumental Junit test case, and I can run it from the command line from my pc using the following shell script : adb shell am instrument -w ...
0
votes
1answer
47 views

/dev/zero or /dev/null for redirect?

I understand that the standard to redirect to is /dev/null, but why not use /dev/zero? Does it not have the same effect? Another question, what do all the 1>> 2>> &>> ...
0
votes
1answer
24 views

Change value in config without opening

Is it possible to change/uncomment value in linux configs without opening and go to line? Example: In php.ini we had expose_php = On and we want turn it off: $: magic_cmd "expose_php = Off"
0
votes
1answer
27 views

Search a string between two timestamps starting from bottom of file

I was trying to find a string Cannot proceed: the cube has no data in huge test.txt file only between timestamps yesterday 22:30 pm to today 00:30 am. Script: tac test.txt | awk -v today=$(date ...
-1
votes
2answers
44 views

If we have a collection of Linux computers on a LAN, how to write shell script to shutdown all computer [duplicate]

I have lab and in that ,collection of Linux computer are connected in LAN. i want how to writ e shell script to shut down all PC when we run that shell script.
2
votes
3answers
174 views

What exactly do the sudo -s command? and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
-1
votes
2answers
25 views

What is the risk when editing crontab file without the “crontab -e” command?

I developed a script in which I add lines to the crontab file with echo command and I remove lines with sed command. I do not know the risk of that especially that I find in some web site that we ...
1
vote
1answer
23 views

Echoing aliases to .bashrc

I want to echo an alias straight into my .bashrc file. Here is what I am using: echo alias cdear='cd | clear' >> .bashrc However, the new line in .bashrc does not contain the quote marks. I ...
1
vote
2answers
70 views

Use alias source with relative path

I want to add an alias file to my project folder to quickly open and edit files in it with a simple shell command. To make it more portable, I would like to use only relative paths. I want something ...
0
votes
0answers
26 views

Idle timeout Bourne-style shell

Is there any way to timeout idle users in Bourne-style shell (/bin/sh). man sh does not talk about it. http://www.freebsd.org/cgi/man.cgi?sh TIMEOUT or TMOUT shell env variables in /etc/profile ...
0
votes
1answer
53 views

Execute the shell command in subshell or in background?

Actually I mainly work with Ruby, but now I have created a bash script file. From this script file I am displaying the messages on the screen. Here is my scenario. I have used aosd_cat module for ...
0
votes
1answer
43 views

How do I call function after prompt for input in a Linux shell script?

The title says it all. After Im prompted, I want yes and no to respectively call a function. # Check to see if you ran this script before echo echo I need to know if this is your first time... while ...
0
votes
1answer
26 views

Check shell Script copy Status

I have a cron script and i need to adjust it; Actually some clients are generating in a directory some files, my task is to backup that files to a tape, and i need to make a if then else cp $files ...
1
vote
1answer
25 views

extract file content to mutliple files base on match pattern

I am new to unix. I would like to process this file. PP_NAME_1 jprovider|J Driver Provider|${J_DRIVER_PATH}/jcc;${J_DRIVER_PATH}/jcc_license_cu|${J_DRIVER_NATIVEPATH}|com.jcc.Connection ...
0
votes
1answer
72 views

Shell script to check all the URLs from a file or list

I'm looking for a shell script to check a list of URLs and give output. For example: http://abc.com/index.php http://abc1.com/index.php I may place them in a separate file or inside the script. I ...
0
votes
1answer
31 views

get a command process back after closing a session

Arrrgh! I'm using one of those drop down shells (guake, I think) on Linux. I'm dd-ing an SD card, and I accidentilly closed the shell session that was running that command. The light is still ...
0
votes
2answers
24 views

Copy shell configuration from one machine to another?

I've got login to another server where shell configurations are not like I would want. For example I don't see my username and CWD on prompt, and when I press arrow key, instead of giving last entered ...
0
votes
1answer
48 views

email command not working in UNIX Linux

I tried with 2 email UNIX commands mail and mutt from my Red Hat Linux box. It's not sending any mails to the email id I specified. echo "My message" | mail -s subject "test email" <my valid ...
3
votes
1answer
64 views

Why does my .bashrc get read when I run noninteractive commands over ssh

I've prepended each of my bash config files (~/.bashrc,~/.bash_profile,~/.profile) with echo NAME_OF_FILE, i.e. I get '.bashrc' when I source in ~/.bashrc. What baffles me is why I get and ...
1
vote
1answer
22 views

How can I restrict a bash find to only specific sub-sub-directories

I'm trying to list all the files in a specific sub-directory but different directories which are themselves on a different volume. The following works, but only on a fully specific sub-directory (and ...
1
vote
1answer
49 views

Get login shell of a user not in /etc/passwd in linux

How do I get the default login shell of a specific user in linux. The user isn't necessarily in /etc/passwd. They may be logging in with NIS or LDAP or other pam method.
-1
votes
1answer
47 views

Copy one directory to another while retaining its structure

Let's assume I have the following source directory: source/ subdir1/file1 subdir1/file2 subdir2/file3 subdir3/file4 And target directory: target subdir1/file5 subdir2/file6 ...
0
votes
2answers
83 views

How to continue running a program in bash

I have made a bash program in Ubuntu. The program is "rock, scissors paper with computer". I want to continue this program until the message "you win, bye bye". Could anyone suggest a method for me ...
1
vote
1answer
55 views

sudo command with equal sign (=) gets confused for environment variable

I'm trying to run various commands through sudo, where the equal sign (=) is a part of the command. Under certain cases, it seems that sudo confuses that sign for setting and environment variable. I ...
0
votes
1answer
47 views

How can I have Emacs window(s) and cygwin shell running simultaneously on Windows?

I have Cygwin working with Emacs 24.3.1 on windows 8.1 with Emacs downloaded from the Cygwin installation, however I can't use Emacs and the Cygwin shell at the same time or open up multiple Emacs ...
1
vote
2answers
32 views

Is there a terminal supporting embeded graph under linux? [closed]

everyone. I want to know if there is a graphic terminal which support viewing images inline. The ipython qtconsole is very cool because it has the '%matplotlib inline' magic. But I'd like to use ...
0
votes
1answer
54 views

how to change directory in ubuntu

I'm trying to change the directories of a symbolic link. ln -s /usr/local/mysql-cluster-gpl-7.1.5-linux-i686-glibc23 /usr/local/mysql When I type command cd /usr/local/mysql it is giving me error ...
0
votes
1answer
27 views

Sed is not Interpreting Pipes Correctly

OK, this is hard to explain, so I will give a reproducible example: I have a text file test.txt contains the line: somesetting-parameter /an/old/path I want to replace it with a path I can get via ...
0
votes
0answers
9 views

Output of usbmon ( length field )?

In http://www.mjmwired.net/kernel/Documentation/usb/usbmon.txt#163 it is written that before status tag ,there is data length field ,in my output for usbmon http://pastebin.com/b6U7Je7h please ...
3
votes
1answer
97 views

How to use usbmon for knowing amount of data transferred from usb (pendrive )?

Please someone explain me in simple terms how to use usbmon to track the amount of data transferred from pendrive ?
0
votes
1answer
61 views

redirecting output in crontab

I have a shell script to monitor table stats and java apps. It works fine when I run manually. But if I put it in the crontab it will get stuck if I don't redirect it's output with export display ...
1
vote
2answers
83 views

How to stop shell script if curl failed

I have script that used curl when i pass wrong parameters to script curl failed but script continue executing. I have tried use curl -f/--fail parameter but problem does not solved. What is the best ...
0
votes
1answer
46 views

Using find and wc -L to find files containing lines longer then 500 characters

I have this command: find . -name "*.php" -exec wc -L '{}' \; And I believe it gives me the count of the longest line for each file. But I'm looking for a way to only print out the count and file ...
0
votes
1answer
37 views

How to print process id into statment

I have assigned a work to take take all process and make them into a statement. So I tried this script. #!/bin/bash a= ps | awk '{print $1}' echo select $a So I am getting this output PID 1838 ...
1
vote
1answer
34 views

How do I identify shell script execution vs dot execution

I'm writing a bash script that needs to run on the current process for it to be useful. That is, I want to make sure that the script was invoked with source script.sh or . ./script.sh and not ...
1
vote
1answer
43 views

writing more complex math input to fish shell

The fish documentation explains that the math command is essentially a thin wrapper to bc. The bc documentation has further info about more complex ops: If bc is invoked with the -l option, a math ...
1
vote
3answers
101 views

Linux if elif else fails

I am trying to find if mount point 1 is available and if not mount it. If mount point 1 fails, mount 2nd one. If that fails then display a failure message. Here is the code: mount > /tmp/log; ...
2
votes
1answer
34 views

Are there limits to file length piped from find to xargs or using find -exec +

In question [ Find and delete all the directories named "test" in linux ] on this site, the best answer talks about using these two commands: find . -name test -type d -print0|xargs -0 rm ...
0
votes
1answer
53 views

Shell script truncated when run from cron or at

I'm seeing some very strange behavior on a Linux based NAS (DNS-323) I have. I'm using a simple shell script to back up the files on the NAS to another box. After making some recent additions, the ...
0
votes
1answer
85 views

How do you run a command as another user on Linux?

I have access to a linux server where I can sudo to 'foo' like this without a password: sudo su - foo Once I am the 'foo' user I am able to run a script like this: /dir/foo_user_script.sh The ...
1
vote
4answers
64 views

Skip parameter in Linux bash

I need to write a shell-script which handles 3 parameters ($1 $2 and $3). Within the bash I have to skip parameter 2 (I'm actually writing something like ./script.sh para1 para3). The script is OK. ...