1
vote
2answers
23 views

How to remove file modification tracking on an Emacs buffer?

I have a *shell* buffer in Emacs where I get a Linux command line shell interface. On occasion, I wish to save the buffer's contents to disk for future reference were my session to exit and once ...
0
votes
2answers
45 views

linux shell command to grep Unicode Character 'ZERO WIDTH SPACE' (U+200B)

How can I grep for Unicode Character 'ZERO WIDTH SPACE' (U+200B) in linux grep '%U200B' filename?
0
votes
1answer
24 views

How do I make sure that bash (not tcsh) is used in Linux?

I have a bash script where I use ssh to connect to another server and run some commands there. I found some sites that the error (Warning: no access to tty (Bad file descriptor). Thus no job control ...
0
votes
0answers
36 views

Automaticly run xinit from rc.local as different user

I'm working on some tuning of my raspberry pi b+. So I decided that midori should start automaticly after autologin. With startx it works without problems, but X is still to ressource hungry. So I'll ...
0
votes
1answer
25 views

How to get when run `top` command ports listed?

How to get when run top command ports listed ? I get info about process but I need port to see ( process dies very quickly , 0 seconds, and I cannot grep after ps aux ). Is possible to top command ...
1
vote
1answer
21 views

Hide all output from a background process

I have a bunch of commands in my zshrc which invoke another command in the background. The background command is an alias to a text-to-speech program (I use it to give me audio cues when processes ...
1
vote
1answer
26 views

How to extract certain database from full Mysql dump?

I have regular backups of my mysql server.For convenience I set it up as a single Mysql nightly dump. Now I need to restore one of the databases from the dump. How do I restore a single database ...
0
votes
2answers
72 views

Linux zip and exclude directory in Bash script

I am trying to write a bash/shell script to zip up a specific folder and ignore certain sub-dirs in that folder. This is the folder I am trying to zip "sync_test5": My bash script generates an ...
2
votes
3answers
53 views

In a Linux shell, why does backslash-newline not introduce whitespace?

When using the Linux shell, I come across the following situation: $ A=B\ > C $ echo $A BC In my mind, when the newline encountering escape character, it can not be a CR character but it still ...
0
votes
0answers
26 views

Writing a secure login script

I'm trying to write a secure login script to allow a user to have limited access to a server and change particular options. My method for doing so is via a python script executed by the users ...
0
votes
0answers
22 views

how to detect availability of GUI

For Linux: I have a text mode installation (bash) script and a graphical mode setup program (a Free Pascal binary). I'd like to run the graphical setup when a GUI is available. How do I detect which ...
0
votes
0answers
25 views

ffmpeg - how to see what scaling algorithm is used

I'm upscaling a 200x200 video to 400x400 using the -sws_flags scaling option to set the scaling algorithm. Now, I can't tell by the console output if some algorithm was used, neither by the looks of ...
0
votes
1answer
36 views

shellinabox - How can I restrict access to certain users only?

I've got a Ubuntu 14.04 machine which I've set up with shellinabox. Now I would like to restrict access to shellinabox to only a certain user account. Nobody else should be able to log in with it. ...
1
vote
2answers
43 views

Choose which binary is default binary on Mac OS X Mavericks

I have installed the latest SVN 1.8 via homebrew on my Mac. However now If I run svn --version I get back that I have 1.7. Next thinng I run which -a svn which then shows me I have it twice: ...
0
votes
2answers
40 views

Renaming files from a list of filenames

I'm still very new to shell scripting so I'm sure this command is all kinds of wrong. I am trying to rename a folder of files to the names in a txt file. The precondition is that the filenames.txt and ...
1
vote
2answers
48 views

What is the meaning of “var=${str=expr}” in linux shell?

What is the meaning of "var=${str=expr}" in linux shell? Who can explain it for me specifically?
5
votes
1answer
96 views

Why there is an empty line begin with “*” in the result of history command on linux?

Today at work, I wanna know a history command which I am not very familiar with and I was sure that I just executed a little while ago. However, when I ran history on the same terminal window, I found ...
0
votes
1answer
16 views

psql ignores my PAGER variable

I want to use less as my default pager. Therefore I have PAGER=less in my .bashrc. It's sourced properly: $ echo $PAGER less However, psql still uses more if I call it with psql. BUT: If I call it ...
-2
votes
1answer
53 views

how to run command in another terminal in Linux script

In Linux shell script I have to run few commands under another user but I am enable to. Please advice some suggestions. $ jumpto -T -u ... after this command it enters in another terminal and I ...
1
vote
4answers
59 views

How to rename a lot of files in bash shell?

Sorry for the question. I searched the internet a lot, but couldn't find an answer which worked (though there were a lot of suggestions). So, I want to rename A LOT of files. Writing all file names ...
0
votes
1answer
33 views

Small bootable package to enable ssh client?

I've been trying to find the smallest possible package to put on a cd/thumbdrive that will allow me to use an ssh client on a wired networked computer. I'm talking about really barebones stuff, no ...
0
votes
1answer
42 views

stop all child processes when 1 of then returned exit code 1

I have 2 or more build processes to run in background. I want to stop all the build processes if one of them exit with code other than 0. ./build-1.sh & ./build-2.sh & ./build-3.sh & wait ...
0
votes
1answer
42 views

CentOS 6 - Send user defined command from PHP

I have a web control panel and I need my allow my users to send commands to their application. I a similar problem to SQL injection. $user_input='good command'; shell_exec('tmux send-keys session1:0 ...
1
vote
1answer
55 views

Batch convert txt file encoding

I have about 700 files that were the results of a closed caption software process. I can open the files on my PC or Mac in a GUI, but when I open it on the server with nano, I get this: ...
0
votes
3answers
50 views

Starting programm into window manager

Is there a way to start a program from a terminal, that is not a "child" of the window manager (p.e. XFCE), into a window manager? The executed program has to be detached form the terminal (and my ...
1
vote
1answer
33 views

Different globbing behavior with same shopts?

I have multiple shells (bash) open on the same machine, and in one of them, globbing seems to have stopped. ls * gives ls: *: No such file or directory, and so on. I figured that I must have set some ...
0
votes
0answers
33 views

mc-wrapper does not exit to MC_PWD directory

I recently installed openSUSE 13.1 and set up the mc in typical why by aliasing mc with mc-wrapper.sh to have it exit into the last working directory in mc instance. However this does not seem to be ...
0
votes
2answers
89 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
36 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
41 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
55 views

Using /usr/bin/env to change directory [closed]

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
30 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
60 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
34 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
74 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
67 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
54 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
54 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
27 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
35 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
52 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
197 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
31 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
36 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
106 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
42 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
103 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
78 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
46 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
40 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 ...