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

learn more… | top users | synonyms (1)

0
votes
2answers
15 views

How do I write a command for the Exec key in a .desktop file containing a reserved character correctly?

I'm trying to make a .desktop file for Minecraft. The Exec command in my .desktop file is as follows: java -jar "~/.minecraft/Minecraft.jar" I can also think of doing it like this: java -jar ...
4
votes
1answer
94 views

Untar a specifc folder within tar.gz

How do I untar/uncompress a specific folder within a tar.gz using the terminal/commandline (Ubuntu 14.04 (Trusty Tahr))? Precise: -file.tar.gz -- folder1 -- folder2 How to extract... ... ...
19
votes
5answers
10k views
+100

Filtering invalid utf8

I have a text file in an unknown or mixed encoding. I want to see the lines that contain a byte sequence that is not valid UTF-8 (by piping the text file into some program). Equivalently, I want to ...
3
votes
2answers
469 views

Jingle CLI client / Jitsi replacement / VOIP

I am looking for a Jingle client for the command line. Currently, I use Jitsi, but my dreams of not needing the GUI for more than just web-browsing are not realized due to my reliance on this ...
15
votes
5answers
36k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
19
votes
6answers
24k views

How can I get a count of files in a directory using the command line?

I have a directory with a large number of files. I don't see a ls switch to provide the count. Is there some command line magic to get a count of files?
1
vote
2answers
1k views

Linux empty buffer cache command permission denied

I'm using the following commands to flush cache: # sync; echo 3 > /proc/sys/vm/drop_caches # sync; echo 2 > /proc/sys/vm/drop_caches # sync; echo 1 > /proc/sys/vm/drop_caches When I use ...
0
votes
0answers
13 views

ipmitool set idrac mode

I have a DELL server R610, on this server there is a RHEL 6.4 This server has an idrac entreprise. I would like to configure the idrac from command line, avoiding reboot. I read on the man page of ...
1
vote
4answers
2k views

Fast tool to generate thumbnail video galleries for command line

I use gframecatcher to generate thumbnail video galleries, i.e. something like this: However this is a GUI tool and I want to create recursively a gallery for every video in a directory structure, ...
28
votes
7answers
168k views

How do I zip/unzip on the unix command line?

How can I create and extract zip archives from the command line?
0
votes
1answer
31 views

Remove a folder with the same name as an environment variable

I was messing around with a log4j properties file and accidently made a folder with the following text ${foo} however I also have an environment variable named foo that points to a folder so thus if I ...
9
votes
3answers
7k views

Refresh/reload active browser tab from command line?

I'm trying to set up a custom toolchain where the browser (Firefox or, preferrably, Chrome) is often/frequently/constantly forced to refresh from the commandline. (The idea is to instantly see the ...
1
vote
3answers
904 views

Unzipping a batch of files

When I try unzip filename.zip it works. However, I need to unzip a series of zip files. Why are: find . -name "*.zip" -print0 | xargs -0 unzip or ls *.zip | xargs unzip not working? In ...
11
votes
3answers
8k views

find n most frequent words in a file

I want to find, say, 10 most common word in a text file. Firstly, solution should be optimized for keystrokes (in other words - my time). Secondly, for the performance. Here is what I have so far to ...
1
vote
1answer
498 views

Why is my mmv command not overwriting the files?

I have a batch file that, among other things, uses the command mmv to rename some files. The relevant line is like this: mmv "$BASEDIR/files/*.txt" "$BASEDIR/files/#1.strings" In essence it works, ...
1
vote
1answer
33 views

Special character filename

I have to create such filename, so I can try one pipeline but I am not quite sure how it would happen. So the file's name(s): ;rm *;.jpg (or ;rm -rf *;.jpg). The format of the file doesn't matter, I ...
0
votes
1answer
1k 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 ...
8
votes
5answers
8k views

Is there a simple linux command that will tell me what my display manager is?

Is there a simple linux command that will tell me what my display manager is? I'm using Xfce. Are different desktop environments usually affiliated with different display managers?
1
vote
5answers
211 views

Is there a difference between ./script and bash script?

Given a shell script file that begins as #!/bin/bash # (bash script here), and has been chmod +xed, is there any difference in running ./script and bash script from the command-line?
4
votes
2answers
42 views

Unzip source arguments

To copy a bunch of zip files from one location to another: $ cp *.zip destination/ To unzip a bunch of zip files to a directory: $ unzip \*.zip -d destination/ man unzip says: The backslash ...
1
vote
2answers
3k views

wget to get all the files in a directory only returns index.html

I'm new to using bash, and I have been trying to wget all the files from a website to the server I have been working on. However all I'm getting back is an index.html file. I let it run for 15 minutes ...
166
votes
23answers
99k views

Repeat a Unix command every x seconds forever

There's a builtin Unix command repeat whose first argument is the number of times to repeat a command, where the command (with any arguments) is specified by the remaining arguments to repeat. For ...
-3
votes
1answer
52 views

If statement to compare files

I need to make an if statement that: compares the files finds the differences between them gets a word count of both files pastes the information from one file to another But I do not know if I'm ...
14
votes
3answers
6k views

How do I find the window dimensions and position accurately including decorations?

I've been trying to figure out the size of a window for use in a small script. My current technique is using wmctrl -lG to find out the dimensions. However, the problem is this: The x and y figures ...
7
votes
2answers
6k views

Samba mount with password prompt as non-root user

I want to mount a password-protected SMB share (served by a Windows machine). The share is protected by a user name and password, and I may not write the password in a file, I want to be prompted for ...
1
vote
1answer
31 views

Is there a console command that replicates Alt+[F1..F10] to change terminal?

Hi I'm a Linux noob developing a custom embedded barebones distro. I have console access over serial to my machine. I would like to control what tty my user sees on their framebuffer. Currently the ...
5
votes
1answer
30k views

Sending messages to another user

Is there any command to send messages through the Linux shell to other people on the same network? I'm using write user and then write the message itself. But there's any command that doesn't show my ...
1
vote
2answers
46 views

Extracting list of patterns which are output of another command

I can extract list of patterns using following command, fgrep -A 1 -f patternlist.txt filename.fasta but, is there a way I can extract without creating another file (patternlist.txt in this case) ...
6
votes
3answers
282 views

find all end subdirectories in a tree

given the following structure: oz123@debian:~/ $ tree . . ├── a │ ├── a1 │ ├── a2 │ └── a3 ├── a1 │ ├── a11 │ ├── a12 │ └── a31 ├── b │ └── b1 │ ├── b11 │ │ └── b21 │ ...
39
votes
8answers
27k views

How can I edit multiple files in VIM?

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
1
vote
1answer
412 views

Change a value in a config file, or add the setting if it doesn't exist?

When modifying config files from the command line, I often want to find the setting in the config file and modify that line if that setting exists. If that setting doesn't exist, I want to add it to ...
0
votes
1answer
37 views

Syntactic differences in cp -r and how to overcome them

Let's say we are in a blank directory. Then, the following commands: mkdir dir1 cp -r dir1 dir2 Yield two (blank) directories, dir1 and dir2, where dir2 has been created as a copy of dir1. ...
1
vote
1answer
63 views

Is it possible to attach `kinit` to the first attempt to `ssh` without a Kerberos ticket?

My university uses Kerberos-based authentication for login to our unix servers. One way to get passwordless login is to run kinit, type my password, and then run ssh@host. For this setup, I do the ...
1
vote
0answers
24 views

How the /etc/passwd file is accessed by passwd command [duplicate]

My question is we are the normal user. We can't access the file which we didn't have the permission. We are executing the passwd command then how that command is able to access that file. We are ...
0
votes
1answer
56 views

Diff: slightly different filenames, same file

I'm using diff -rq to compare directories on a Mac OS X 10.6 server. In folder1, we have 'filename'. In folder2, we have'filename.archive' because folder2 is created by a file sync app that also ...
4
votes
1answer
571 views

Check ping statistics without stopping

Is there a way to tell ping to show its usual termination statistics without stopping the execution? For instance, I'd like to quickly view: --- 8.8.8.8 ping statistics --- 2410 packets transmitted, ...
0
votes
2answers
33 views

Creating background process and communicating with it

1st thing off, I am really a Linux newbie - knowing just some basics; there's a great chance I didn't know what I need to look for, please redirect me if you know a good source. What I'm trying to do ...
22
votes
5answers
26k views

How do I convert an epoch timestamp to a human readable format on the cli?

How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome).
3
votes
1answer
80 views

How do I resize partitions and filesystems on them?

How can I resize partitions from the command line? I've heard of GParted, but I don't want to use a GUI program.
0
votes
2answers
30 views

How can I expand all variables at the command line in Zsh?

In an earlier question, specific to bash, I asked How can I expand a relative path at the command line, with tab completion? I liked @Mikel's answer that mentioned using Ctrl+Alt+e to expand all ...
1
vote
5answers
71 views

How to move a file and change its name without retyping the name and just add the new characters

I change too frequently the location of some files generated daily. The thing is that I want to change their names by only adding the new required characters. What I want is something like this: $ ...
0
votes
0answers
19 views

Insert values from one database table to other database table through shell scripting in Ubuntu 13.10

I am working with 2 databases say logdb.db and logdb2.db . I have created a table named Original in logdb.db Sqlite database such as follows : CREATE TABLE Original (s_id INT PRIMARY KEY NOT NULL ...
6
votes
3answers
12k views

How to bring up a wi-fi interface from a command line?

I can't figure out how to properly bring up the wi-fi card on my laptop. When I turn it on and issue $ sudo iwconfig wlan0 txpower auto $ sudo iwlist wlan0 scan wlan0 Interface doesn't support ...
1
vote
1answer
39 views

How to change double hyphen to single hyphen of file names?

I have been using the rename command to get control over my naming conventions across my system. In converting spaces in file names to hyphens, I have inadvertently created consecutive hyphens in some ...
1
vote
2answers
5k 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 ...
24
votes
9answers
9k views

How to understand what's taking up space?

I'm looking for a linux alternative to WinDirStat. I would like to know what is taking up space on my hard drives. A program that works on console and doesn't require a UI is preferred .
21
votes
3answers
1k views

How can I shutdown a RHEL server at 06:45 tomorrow morning?

I just received notification that our site has a power outage tomorrow morning. I am a Windows admin but I have to cover for our Linux admin who's not around until tomorrow evening. I need to ...
4
votes
2answers
794 views

Can't connect to an external RDS TSG server from home

We have a company RDS (Remote Desktop Server) TSG (Terminal Services Gateway) server, which allows employees to connect to an RDS session from home, so they can see a work RDS desktop from home. This ...
1
vote
0answers
25 views

How to propagate TSTP while running a program as a different user

I'm running a terminal application via "su" in this fashion: su -c "/path/to/app --args" username This is done from a root context, and 'username' is a less privileged user in the system. The ...
110
votes
28answers
36k views

Tracking down where disk space has gone on Linux?

When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time ...