Tagged Questions

Shells are used to interact with the OS and launch other applications. Most shells also have built-in commands such as directory listings and moving and copying files around the file system. Other shells, such as Bash, can be heavily scripted to do a multitude of tasks.

learn more… | top users | synonyms

0
votes
1answer
23 views

Pipe and watch piped output?

I want to make a shell-pipe like this: producer | analyser > report.txt and watch the output of producer while it is generating data (a big log-file) for analysis. How can I do that?
2
votes
2answers
28 views

Basic command line tutorials for Windows and *NIX

I am writing how tos for Plone CMS ( http://plone.org ). Often how tos begin with "you need to know the basics of command line use" Do you know any basic tutorials for Windows command line (cd, ...
0
votes
1answer
40 views

Oneliner for multiline regex s/,\n]/]/g?

Can someone provide a simple one-liner to remove certain linebreaks ? In vim I do :%s/,\n]/]/g this should be possible with a very simple one-liner IMHO, but how?
0
votes
0answers
12 views

Use user-installed shell?

How do I change my shell to one installed in my home directory? I installed a new zsh in my home directory, which is picked up: >> which zsh >> /home/myname/bin/zsh It's not listed in ...
1
vote
0answers
27 views

Emacs Shell backwards regexp search too slow

When I use comint-history-isearch-backward-regexp (M-r) and I mistype something so it will not be found Emacs starts searching backward for 500 results before giving up. I cannot Control-g out so it ...
0
votes
2answers
51 views

change default shell from zsh to bash

I'm trying to change my default shell in RHEL5 from zsh to bash. I tried to the methods mentioned in this thead. By typing sudo /usr/bin/chsh -s /bin/bash, the system says sudo: /usr/bin/chsh: ...
0
votes
2answers
53 views

Is it possible to add an exception with a “ls -l *”

Is it possible to do for exemple: ls -l * which print the content of all a directory. And add an exception, for exemple, test.cpp In order to print all files except the test.cpp.
0
votes
1answer
4 views

Convert ppt to jpg

I am using an Ubuntu system. I want to convert ppt or pptx to jpg using terminal commands. I have libreOffice and ImageMagick installed in my system. I am successfully converting pdf to jpgs using ...
0
votes
0answers
31 views

Generate xml file from city list

I have a city.txt file with over 1000 lines (one city name per line) , and also a format.xml file with this code block: <ss:Row ss:Height ="22"> <ss:Cell> ...
2
votes
1answer
33 views

How different shell scripts map to different OSes

New to Linux and have a few questions about shell scripting: shell C shell Bash shell Bourne shell korn shell So many "shells"! With respective to these, how do I tell which interpreters my Linux ...
1
vote
3answers
38 views

Grep fail to ouptut to a pipe?

I'm having problems with grep filtering of make output. In particular, make target 2>&1 | grep -E --color=never "^make.*" works as expected, but the following will print no output to the ...
1
vote
0answers
21 views

Windows 7 - right click menu commands for file types [closed]

Possible Duplicate: What program do you use to edit file associations in Vista and Windows 7? it was fairly easy to setup addition right click commands in windows XP. for example you ...
0
votes
3answers
87 views

Can I create a configuration file for a shell script?

Is it possible to create a .sh shell or .command file with a configuration file? I need to backup websites via Terminal and be able to put some data to configuration files, and have the shell execute ...
1
vote
3answers
71 views

How to “undo” unzip command?

I used "unzip XXX.zip" to extract a zip file, unfortunaly, i make a mistake. Now i want to delete all the file and directorys generated by "unzip". How can I undo it?
-3
votes
0answers
47 views

OSX Terminal Shell to Backup Website+Database [closed]

all i need to be write shell script in macosx to backup my website files and database and compress it and download locally to computer. please help me.
0
votes
1answer
42 views

Clear a line in the terminal

I sometimes start writing a command in the terminal (iTerm2) which half-way written I want to erase. How can quickly remove all the characters on the line being worked on in the terminal?
1
vote
1answer
39 views

Windows Shell integration parameters

I'm trying to integrate a shell menu entry for all files (*) to encrypt them using a tool i already have made. I have managed to create the entries but I don't really understand how to send the path ...
2
votes
4answers
93 views

Learning Shell Script, What's Next? [closed]

I've had finished learning "Shell Script" in Linux so I'm now intermediate near advanced level but I can't guess how can I use this scripting language to make things/tiny programs! Just as having the ...
1
vote
4answers
53 views

Show PID of process just launched in ZSH

Can I show the PID of a process that I just launched, ideally at the end of the line of the command? Example: root in ~: mysqld .................. [PID 34567] 12121 mysql-logs start to come in... ...
0
votes
2answers
74 views

Cutting and moving files using the Linux terminal

What is the command I can use to cut and then move a file from one location to another from a Linux terminal? Is there any website that lists all the commands for a Linux terminal?
2
votes
5answers
159 views

Best practices to alias the rm command and make it safer

Some time ago I erroneously deleted my home folder because I ran a rm -rf * on the wrong terminal, whose working directory was the home folder! I wish I had an alias for the rm command, but it was ...
1
vote
1answer
35 views

Add time to an OS X Parental Controls managed account with a shell command

I imagine that there's a simple counter for daily usage, and that this can be modified, but I've been unable to find any documentation on where or how to do this. Does anyone know?
0
votes
2answers
55 views

Syntax Highlighting for MySQL Shells?

Are there any MySQL shells that support syntax highlighting? I know in my.cnf, you can set the shell string with, for example: [mysql] prompt=(\\u@\\h) [\\d]>\\_ But is there any more ...
3
votes
7answers
175 views

unix - split a huge .gz file by line

I'm sure someone has had the below need, what is a quick way of splitting a huge .gz file by line? The underlying text file has 120million rows. I don't have enough disk space to gunzip the entire ...
1
vote
2answers
34 views

How to let shell return to the previous line after exiting a full-screen process like Vim

I connect to Z-Shell on a Red Hat Enterprise Linux 6.2 machine via Putty. After I exit a full-screen process, eg Vim and less, in Unix shell, the shell prompt starts at the last line of the screen. ...
0
votes
1answer
30 views

How to by-pass user interactions in a script?

I am trying to automate the installation of a program through a shell script. There are a few steps which require user interaction from the command line (confirmation, yes/no, etc.). What is the best ...
0
votes
3answers
48 views

What provides autocompletion? Shell or emulator?

I have been using Linux for some time now. Now, I have question about auto-completion of commands and directories in a terminal window. When I press a tab key the terminal auto-completes or gives ...
2
votes
1answer
52 views

How to get ZSH previous command's history number in prompt?

I'm wanting to add the previous command's history number to my prompt, as well as the exit code. At present, %h[%?] Gives me the current history number, as well as the last exit code. What I'd ...
0
votes
1answer
48 views

Sed pattern for multiple lines

I want to remove all create table statements from a mysql script, but the statement runs over multiple lines. Like this: Create table ......NEWLINE... NEWLINE... NEWLINE....; So I tried this ...
0
votes
1answer
17 views

seq with regex, error message for mysql quotes

Is there some tool that auto quotes regex for seq? I can't figure out what I'm doing wrong. I always get this error unterminateds' command` sed -i 's/INSERT INTO `tablename.*`/INSERT INTO ...
1
vote
1answer
57 views

How can I change the shell in Windows 98

How do I change the default Windows shell from explore.exe to my own custom shell in Windows 98?
2
votes
0answers
85 views

hardlinking takes a lot of space

I made an rsync incremental backup script for my server that will copy a MySQL database backup and a specified folder path to a remote server. Here's the code on Github. Code excerpt from lines ...
0
votes
1answer
85 views

How to write a script that does what less does?

Question: Create a script such that it is a command that has the same effect as the "less" command (implement the script by calling "less"). What I wrote: #! /bin/bash for index in "$@" do less ...
0
votes
0answers
26 views

Subtracting strings (that are numbers) in a shell script [migrated]

I made a shell script that finds the size of a directory, returning it in human readable format (e.g., 802M or 702K). I want to calculate the difference between the sizes. Here's my shell script so ...
1
vote
1answer
75 views

How to get window title in windows from shell

I can set title via windows shell using command title some string but how can I get the title of some process? I tried command tasklist /v, but my title is very, very long, that's why I receive only ...
1
vote
2answers
64 views

Bash prompt output colors change after first 2 lines of output

I customized my bash PS1 prompt with this ~/.bashrc file. I can't seem to figure out why my output colors change after the first 2 lines of output. Any ideas what could be causing the issue?
0
votes
0answers
12 views

Getting fcron and RVM work together

I'm trying to make RVM and fcron work together. Apparently fcron does not read directly or indirectly any sort of env variables. Which makes RVM futile and scripts fail. I have this script which ...
2
votes
4answers
52 views

Get the newest file from non-current directory

I am having trouble executing a command which will give me the latest file from another directory. Example: ls -tr | tail -n 1 /prj/somedir/anotherdir/closerdir/targetdir there is a list of ...
4
votes
3answers
93 views

How can I do Ctrl-Z and bg in one keypress to make process continue in background?

So I realized I follow this pattern of suspending the task and then letting it to continue too often with the Ctrl-Z bg sequence, I was wondering is there any way to compress that to single keypress? ...
3
votes
2answers
59 views

Per-directory bash/zsh history log files

I find I do a lot of work on a project in a set directory. Sometimes - a few months down the track, I need to redo something on that project but I can't remember what the hell I did. I use mercurial ...
0
votes
0answers
39 views

Number of commands for a shell vs. how powerful a shell is [closed]

So I just started my operating systems class at my university, and my professor said something that interested me, something that I'm not sure if I agree with. He was introducing the various shells ...
1
vote
0answers
22 views

what are commands for tc shaping,queueing and scheduling?

I have 3 virtual machines and i fixed them as a team and in 1 local host now they can ping each other and see each other now how can I write a command to see shaping using traffic controller (tc)? is ...
0
votes
2answers
100 views

what is the command for sending files via shell in UNIX

I have 3 virtual machines and i fixed them as a team and in 1 local host now they can ping each other and see each other now how can I write a command to send 1 file from a virtual machine to another? ...
0
votes
1answer
39 views

Run HTML Tidy in batch on Mac OS X?

I want to run HTML Tidy on a large number of files located in folders and subfolders. I can use the following command in Terminal to run it on a single file: tidy -f errors.txt -m -utf8 -i ...
0
votes
2answers
62 views

What is the error in the if statement in this bash script?

What is the problem with the following shell script? I'm getting [: too many arguments error #!/bash var1=10; var2=20; if [ $var1 % 2 -eq 0 ] -a [ $var2 %5 -eq 0 ]; then #something fi
0
votes
5answers
57 views

What is the shortest most readable way to print the n'th line of a file?

Its about Unix and Linux. Yes, there are many solutions to that, e.g. see http://mywiki.wooledge.org/BashFAQ/011. Some of them are fast as hell (not reading the whole file) and some are slow but ...
0
votes
1answer
113 views

Ubuntu shortcut shell script launcher for multiple items

Ok every day I go through the same routine, and its tediously annoying. So I came up with a thought and wondered if its remotely possible. What I want to do is open maybe 3-5 terminal windows, and in ...
0
votes
1answer
31 views

Symbolic links for directories

Really need a quick help on this. This is the scenario. Created source directory SOURCE : /apps/application_scripts/intl/bin Here I have lot of shell scripts (*.sh) TARGET : ...
2
votes
1answer
27 views

How to only show new processes in Activity Monitor?

Is there any way to make Activity Monitor only show new processes? Can you do this in Terminal instead?
2
votes
2answers
242 views

How do I run an Automator action, shell script or AppleScript on startup in OS X?

I know you can run applications on startup on a Mac, but can you run an Automator action, a Service, a shell script, or an AppleScript on startup instead? I also know you can save all of these as an ...

1 2 3 4 5 18