The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

3
votes
4answers
86 views

Grep the text which matches with a pattern

I was looking for a command which will print the selected portion of a line which matches the conditions. Eg, my text line is like this: p1=X||p2=Y||p3=X||p4=X||p5=X||p6=Y||p7=X I want to print ...
0
votes
1answer
24 views

Change hostname on SUSE Linux Enterprise Server 11 SP3 for VMware

I want to update the hostname for one of my VMware virtual machines running SUSE Linux Enterprise Server 11 SP3 for VMware . I tried changing the hostname using YaST but after reboot the old name ...
1
vote
3answers
422 views

How do I resize a windows partition without using gparted?

Suppose I have a native (i.e. coming from manufacturers) windows 7 installation on a laptop (with an SSD device, BIOS/MBR partition table if that matters). The partition on the device is completely ...
13
votes
3answers
9k views

Add album-art cover to mp3/ogg file from command-line in batch mode?

I am looking for a software in Linux, that will add the album-art/cover to each of the selected files in batch-mode. The album art is a jpg/png stored in my computer. It will be awesome if it can ...
0
votes
2answers
36 views

Live monitoring of background jobs

I executed a command like this: nohup some_command &. Now this command is in the background. I can see it with the command jobs. Example output: [1]+ Running nohup some_command ...
0
votes
1answer
3k views

Proper escaping of double quotations for curl post data?

I'm trying to test out a server, by sending it JSON data and reading the response. I need to POST data like {"item":"value with spaces"} but when I use curl I find that it sends the backslashes as ...
6
votes
1answer
726 views

How to write/edit/update the OsIndications efi variable from command line?

In the need to enter the UEFI firmware setup utility while using ultra fast boot (keyboard drivers are not loaded during POST), I wish to write to the "Os Indications" efi variable. My OS is Ubuntu ...
11
votes
1answer
4k views

Best way to continue stopped move (mv) by merging directories?

I have moved (mv) a pretty large directory on my NAS (Linux based), but had to interrupt the procedure. Not being a regular Linux user, I though I could just continue and merge the rest later in. mv ...
1
vote
5answers
9k views

checking running process

I am new babe to Linux. So please skip to read if you are not patient with begineer. Let's say I am asked to check and shut down the processes that I am not familiar with. So when I ls under bin ...
2
votes
1answer
71 views

Unable to get back to bash prompt after strange command

I was messing about with different wildcards and ran the following command: ls testdir/!(*/) after which I was completely unable to get back to the bash prompt. None of ^C, ^D, or even ^Z worked: ...
40
votes
12answers
24k views

Markdown Viewer

I found a file formatted with Markdown. Could you guys suggest what viewer that I could use to view this type of files? Hopefully one without gui (if it's possible) Update I was actually looking for ...
1
vote
1answer
46 views

Get executable for any command [duplicate]

I want to know which executable gets executed for any command in bash. Example: I have firefox installed here /usr/bin/firefox, it is in the $PATH alias browser=firefox alias br=browser Now I ...
0
votes
0answers
35 views

Man-pages don't include all relevant information

Consider the man-page of this function: sysconf It doesn't have all the information that I need (e.g. all the system variables to be queried). This is an example of what I need: ...
2
votes
1answer
37 views

bash on command event (or shell)

Is there a way to capture all commands executed in a bash or even better in sh? I need a wrapper script that gets called everytime a command is executed. Like when I type cd /home/ I want my ...
1
vote
1answer
53 views

Custom GUI without desktop environment

I want to set up a custom Linux OS primarily for hobby and learning use. It doesn't need a desktop environment, but I do want to at least customize the visual appearance of the window manager and ...
1
vote
4answers
153 views

Grep for a string in file without using pipe

I want to grep for a word in a file in the last n lines without using the pipe. grep <string> filename enables to search the filename for a string. But, I want to search for a string in the ...
0
votes
0answers
23 views

Error installing java on Virtual Machine

I am trying to deploy a server app (BaasBox) to Google app Engine BaasBox requires java 1.6 or higher to execute. when I check for java on the virtual machine using java -version, I get this: ...
22
votes
7answers
57k views

What is the fastest way to view images from the terminal?

The terminal is very fast and convenient way to quickly access directories and files (faster than find and click on the directory). One thing that it cannot show in text-mode is "pictures". What ...
1
vote
2answers
24 views

Randomly copy certain amount of certain file type from one directory into another

Sometimes I have a folder full of jpg's and I need to randomly choose 8 or so of them. How could I automate this so my account randomly chooses 8 jpg's from the folder and copies them to another ...
6
votes
1answer
974 views

What do I need to add a virtual IPsec adapter?

I'm trying to set up an IPsec connection manually from the console with iproute2. What I need is a virtual interface (at best, a virtual IP address could also be sufficient) that IPsec-transforms ...
4
votes
2answers
2k views

xargs : using same argument in multiple commands

Am trying to write a one-liner that can probe the output of df -h and alert when one of the partitions is out [or almost] of space. It's the part using xargs that kicking me in the ass now... echo 95 ...
0
votes
1answer
23 views

Change default XFCE backdrop for all users via cli?

So my situation is that I can change the relevant property for a user if I have Xorg running by xfconf-query, which is the normal way as I understand to do this, but I cannot use this command normally ...
5
votes
3answers
430 views

How to install / parse build dependencies from debian/control?

Let's suppose you downloaded a source code folder, that contains an existing /debian/ folder as well as /debian/control file. Let's suppose the package in question is not in Debian official ...
65
votes
4answers
57k views

How to tell gzip to keep original file?

I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command gzip file.txt results in modifying this file and renaming ...
2
votes
2answers
46 views

Seems like some basics are missing from ubuntu…or I haven't set them up?

I can't define a shell variable like so: $a = "hello" echo $a echo a $a a all lead to nothing. Also, this command doesn't work for me: $ echo "HELLO HOW ARE YOU?" | tr '[:upper:]' '[:lower:]' ...
0
votes
3answers
70 views

Search for string(s) in files and report four lines of context (match and three following)

I have a string (or a list of strings) that is/are to be searched in all the files of a directory.  For example, if I am searching for ABC, and file1.txt contains ABC on line 6, then I want lines 6, ...
1
vote
1answer
41 views

tar in parallel [duplicate]

I have a directory with several hundred sub-directories. I want to tar and compress each sub-directory and name the resulting file <currentDirName>.tar.bz2. I have done: find ./dir -type f ...
2
votes
1answer
95 views

Telnet IAC commands

I want to turn off character echoing in Telnet via linux command line by sending "IAC DON'T ECHO" command. I have been searching everywhere, and I couldn't find how to to do. Basically, I don't know ...
1
vote
1answer
16 views

Application [AWS CLI] Command shortcuts are not working globally

I just installed AWS CLI on a few servers with Ubuntu 14 on. The last server I installed it on, cannot access the AWS CLI from the terminal and run commands. This does not work: aws --version You ...
10
votes
5answers
657 views

What's the best way to take a segment out of a text file?

What's a good way of extracting say, lines 20 -45 out of a huge text file. Non-interactively of course!
0
votes
2answers
88 views

Dynamic change of Linux root password everyday

I want to change my root password everyday based on the date. The password will be like a combination of a string and the date. The below code is working fine. echo -e "pass"$(date ...
2
votes
2answers
101 views

Redirect output of less utility to a file

Here is what I did less -N file1 > file2 what I want is writting file1 into file2 with line-numbers option. But I failed with that. Any suggestion to do that? Why I failed to do it? Thanks.
0
votes
2answers
30 views

Timing start up time for app launched via terminal command

I'd like to see how long it takes a certain app to fully start. Is there a way to do this launching the app via terminal using some command?
0
votes
1answer
17 views

How do I read from memory.pressure_level in a cgroup?

I want to see the memory pressure of the cgroup. But simple cat memory.presure_level fails. How do I know the current memory pressure of a cgroup?
1
vote
2answers
24 views

How can I properly escape a string to be passed to a shell with a command argument [duplicate]

How can I properly escape arbitrary commands? For example: sudo -u chris sh -c 'echo "\"leftright\""' The above echos: "leftright" How would I echo out: "left'right" I've tried the ...
3
votes
1answer
62 views

How to open any file through the command line?

I would like to know if there is a command to open any file in Linux independently of their extension, just as if you were double-clicking it.
-1
votes
4answers
259 views

Unable to use make to install Valgrind [closed]

I am attempting to download and install Valgrind using the following instructions: I get through step 3 just fine, but when I type make I get the message make: *** No targets specified and ...
4
votes
2answers
580 views

How can I copy all users .bash_history files into my home directory?

I am running as root. I want to copy all the users on the system's .bash_history files into my home directory. I can do this to combine all of them into one, but then I can't tell who's commands are ...
5
votes
1answer
135 views

Do not set $? to non-zero on Control+C

My $PS1 in Zsh includes this expression: %(?. %?.) It means «if exit code of previous command ($?) is true, show $?, else show nothing». This is generally useful, but one thing annoys me: shells set ...
2
votes
2answers
45 views

How to move files to files with same name, but different extension

I have a folder A with many small files. In the parent folder there are many folders with other files in them. now in folder A there are files that have the same name as in the other folders, but they ...
3
votes
9answers
3k views

How to generate a year-quarter date from the command line?

I'm interested in outputting a representation of the current year-quarter, as well as the year-quarter for the previous month. If today is 2012 January 1st, I'd like to get 2012q1 and 2011q4 as ...
3
votes
1answer
14 views

Enabling proxy_arp for interface eth2.1

Am trying to enable proxy arp for some of the interfaces, with the normal interface name eth0, eth1, etc [root@eth2.1]# sysctl net.ipv4.conf.eth0.proxy_arp 0 But for interface names such as ...
15
votes
3answers
937 views

Simple way to see the content of directories in Linux/UNIX file systems

In the past, I learned that in Linux/UNIX file systems, directories are just files, which contain the filenames and inode numbers of the files inside the directory. Is there a simple way to see the ...
0
votes
1answer
21 views

Using imagemagick to crop video

I want to crop a video that I have in yuv format using imagemagick. I am using the following command: convert -size 1280x720 my_clip_1280_720s.yuv -verbose -crop 352x288 +repage my_clip_352_288.yuv ...
1
vote
0answers
18 views

Drag-and-drop without the drag

I sometimes need to drag-and-drop files onto an application. (Example — but my question here is not installing Chrome userscripts.) One solution is to use Dragbox, which opens a window from which I ...
0
votes
3answers
57 views

Delete all files that DON'T have duplicate names?

Given a large list of files, containing the following: FILE1.doc FILE1.pdf FILE2.doc FILE3.doc FILE3.pdf FILE4.doc Is there a terminal command that would allow me to remove all files that do not ...
0
votes
1answer
56 views

USB Disk Read-only, cannot format - Turn off write-protection

I have a USB disk which does not allow me to format/mount/unmount or created partitions on it. Using dmesg | tail gives me the following result: I found this post on AskUbuntu and tried using ...
-1
votes
2answers
30 views

Not able to install any package or software on Linux 64-bit

I am using Linux RHEL6 and not able to install any package. [root@linux6 Python-2.7.9]# uname -a Linux linux6.4 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 ...
121
votes
15answers
55k views

How to have tail -f show colored output

I'd like to be able to tail the output of a server log file that has messages like: INFO SEVERE etc, and if it's SEVERE, show the line in red; if it's INFO, in green. What kind of alias can I ...
1
vote
2answers
94 views

apropos regex start with?

I'm trying to use apropos so that I would look for all man pages starting with system. I try: apropos ^system apropos "^system" but these seem to return lines that don't start with system, but ...