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

learn more… | top users | synonyms (1)

-2
votes
1answer
44 views

txt file to zip file

I have a simple text file named as 'file.txt' I want to create a .zip file which only include that 'file.txt'. I tried cat file.txt | zip newZipFun.zip -@. But it compressed my parent folder. ...
4
votes
2answers
17k views

Command to install linux headers fails

I need to install my linux headers for an Nvidia driver install. But I get an error when doing so: peter@peter-deb:~$ sudo apt-get install linux-headers-$(uname -r) Reading package lists... Done ...
97
votes
8answers
42k views

How can I find broken symlinks

Is there a way to find all symbolic links that don't point anywere? find ./ -type l will give me all symbolic links, but makes no distinction between links that go somewhere and links that don't. ...
32
votes
3answers
13k views

How can I “relink” a lot of broken symlinks?

I have a directory tree which has a bunch of symbolic links to files under /home... however, I have moved /home to /mnt/home and need a way to "relink" all of the symlinks. Does such functionality ...
0
votes
2answers
89 views

Open CSV File And Go Straight To Spreadsheet

Part of my software issues various commands to open and view different file types. For instance I use atril for PDFs and eom for PNGs. However I have a slight problem with CSV files. I can open them ...
2
votes
1answer
41 views

Highlighting with regex within ssh session?

I'm working with a lot of routers and switches from Juniper, Brocade etc and no one of those vendors have syntax highlighting or output coloring. Does anyone knows a working solution how to setup ...
4
votes
2answers
95 views

How to tail a log file by time?

Say my log file(log.txt) is something like 2014-01-01 22:30:30 something happened.... 2014-01-01 22:30:31 something happened.... 2014-01-01 22:30:41 something happened.... I want to tail this file ...
28
votes
4answers
53k views

Why do we use “./” to execute a file?

Why do we use ./filename to execute a file in linux? Why not just enter it like other commands gcc, ls etc...
1
vote
2answers
961 views

How to get byobu to start at startup with a command executed, as root?

I want when the computer start, a byobu session is started and a command executed in the first window (windows 0), without requiring any user intervention. It is very important that this doesn't ...
2
votes
2answers
556 views

How to make FreeBSD variant of cal start weeks on mondays?

Can week start day be changed in cal output? Is it hardcoded? Notice: not the ncal.
0
votes
0answers
23 views

Does gdm (>= 3.16.2) expose itself to the command-line?

At risk of asking an XY question, the title is only tentative. Background I'm running Fedora 22 with gdm 3.16.2, sitting underneath an Openbox session. I've recently noticed that switching to a tty ...
1
vote
3answers
73 views

Is it possible to start programs (saved in the menu) from the terminal?

Recently I switched over to Linux Mint. I am finally getting the hang of using the terminal, but there is one question that I find myself coming back to: Is it possible to start a program that is ...
2
votes
3answers
180 views

!(*.sh) works on the command line but not in a script

When I use the code below in a terminal on Ubuntu, it works fine: rm !(*.sh) -rf But if I place the same line code in a shell script (clean.sh) and run shell script from terminal, it throws error ...
0
votes
2answers
60 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 ...
10
votes
4answers
22k views

Getting all files that have been modified on a specific date

Is it possible to find all php files within a certain directory that have been modified on a certain date I'm using find /var/www/html/dir/ -mtime -28 | grep '\.php' to get files modified within ...
11
votes
5answers
584 views

Is there a more succinct alternative to piping to wc for counting files in a directory

If I do ls -1 target_dir | wc -l, I get a count of files in a directory. I find this a bit cumbersome. Is there a more elegant or succinct way?
65
votes
12answers
28k views

How to grep a specific line _and_ the first line of a file?

Assuming a simple grep such as: $ psa aux | grep someApp 1000 11634 51.2 0.1 32824 9112 pts/1 SN+ 13:24 7:49 someApp This provides much information, but as the first line of the ps ...
1
vote
1answer
2k views

How to change camera info in Exif using command line

I have analog camera and I give a film to the lab where they scan it, I wanted to upload it to flickr but want to change info about camera. Right now it's NORITSU KOKI QSS-32_33 and I wanted it to be ...
41
votes
7answers
48k 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).
13
votes
2answers
60k 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 ...
6
votes
4answers
596 views

How to print the name of missing files in a folder?

I have 2000+ files in a folder, but there are few files missing from the folder. Name of the files are like GLDAS_NOAH025SUBP_3H.A2003001.0000.001.2015210044609.pss.grb ...
-2
votes
1answer
60 views

how to delete swarm of ._ files using commandline

I have these files in MAC which have weird ._ character before filenames/folders. Which I want to delete in one shot. Is there a way to do it in commandline? eg. ._js ._css ._image if I go into ...
0
votes
1answer
205 views

How to get mpd to recognize music library?

I have arch running on my desktop and I'm trying to play music with mpd using ncmpcpp. They are both up and running, but the problem is when I open ncmpcpp it doesn't show my music. I copied the music ...
1
vote
2answers
27 views

Jump to specific flag in help/man file

Let's say I'm curious about what a specific flag -T means for a command ls? Is there a way to jump straight to that using man ls...? or, and this is a slightly different question because it's not ...
26
votes
3answers
18k views

How to Determine the Amount of RAM Slots In Use?

I forgot how many RAM modules are installed on my laptop. I do not want to unscrew it but want to look it up on the console using bash. How do I gather this information?
0
votes
1answer
110 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
708 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
10k 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 ...
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 ...
2
votes
1answer
75 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: ...
42
votes
12answers
26k 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
48 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
38 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
40 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
100 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
198 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
39 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: ...
24
votes
7answers
64k 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
31 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 ...
5
votes
2answers
3k 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
45 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
509 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 ...
69
votes
4answers
62k 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
72 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
54 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
98 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
20 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
710 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
96 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 ...