All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
6answers
293 views

On Linux terminals, why doesn't cd.. work?

On Windows/DOS terminals a cd.. works well. On Linux terminals the dots from the cd command have to be separated. I'd like to know how/why is this necessary for the parser to work. If no space is ...
0
votes
0answers
57 views

How can I prevent execution of a command in a Linux shell? [duplicate]

I am trying to find a way to do this: any command that does not match the pattern "hh update D*" will be blocked in folder /A/B/C Practical example of what I am trying to achieve: In folder /A/B/C, ...
1
vote
1answer
141 views

/bin/sh: /usr/bin/wkhtmltopdf: not found

I installed /bin/sh: wkhtmltopdf /usr/bin/ directory. However when I try to run the program by entering /usr/bin/wkhtmltopdf to shell I receive an error /bin/sh: /usr/bin/wkhtmltopdf: not found. It ...
-1
votes
1answer
83 views

What is a system tool? [closed]

I frequently come across the term system tool, so I wanted to understand the exact meaning of it in Linux. Which of the following three explanations of a system tool in Linux is correct? Is a system ...
1
vote
1answer
68 views

Linux command that continuously outputs string of text

At some point I used a shell command that continuously sent a very short string of text to the standard output, but at this moment I can't recall it's name. Its name was something very short, like '...
0
votes
1answer
77 views

How to use the bash shell with Python's in place of /bin/sh

I have commands to execute in the terminal but I want to execute them directly from my python script except that my script it launches the commands on /bin /sh and my terminal on bash: just an ...
0
votes
1answer
83 views

How to Copy Millions of Files from Remote Server to Local One [duplicate]

I have this problem, I have an Ubuntu server (SSH enabled on port 4444). Inside this server there's a directory called /folder/a/, this directory literally contains millions of small size text files. ...
0
votes
1answer
74 views

Move all files into subdirectories named after part of file name [duplicate]

I have a directory that contains quite a lot of files with names made up of artirst's name and album e.g.: Now the task is to go through each of the files, create a directory named after artist's ...
1
vote
1answer
52 views

mixed results from the same command (related to ARG_MAX) [duplicate]

I'm asking a question based on this link How to cause "Argument list too long" error? From the thread, I'm seeing the equivalent error, if i'm running this: >/bin/echo `perl -e 'print "...
-1
votes
1answer
190 views

How to properly write and execute a shell script and exit correctly? [duplicate]

I have written a shell script named startup.sh which does a lot of things (basically start a lot of things for me after turning on my local machine) - here is an excerpt: #!/bin/bash gnome-terminal --...
-1
votes
1answer
568 views

Get command history from remote user on Linux server [closed]

I have a Linuxserver(CentOS) and many users can access this by ssh. I need to get all history commands from users: Date: the time of execution Pwd: executable directory Remote host ip User Command
-2
votes
4answers
116 views

How do I add the file size output together

158416 757249 574994 144436 520739 210444 398630 1219080 256965 684782 393445 157957 273642 178980 339245 6014031 These are the file sizes in my current directory. I got them using the command: ls -...
1
vote
1answer
62 views

why $($var) gives an error?

I am trying to execute the following code in shell but I am not getting the output as expected. The command is as follows: i=1 echo $($i) I am getting an error: Command not found error I think it ...
1
vote
1answer
181 views

How do I print the path of a file in a different directory

I know that if you have a file one.txt in ~/Documents and you cd ~/Documents then realpath one.txt will print: ~/Documents/one.txt. However what if you want to print the path of a file in a ...
0
votes
1answer
745 views

“cd : permission denied” though group has access

Hope the following explains it. apps folder belongs to devgrp with rwx group access and jenkins user belongs to devgrp. however I am not able to cd into the folder as jenkins. P.S: I have logged out ...
8
votes
2answers
434 views

Adding file to tbz files

I'm looking for a way to update thousands of .tbz archive files, so I'll be doing this with a shell script. I need to add one file to each. My question is, is there a faster way to do this without ...
0
votes
1answer
73 views

Do programs like Nautilus uses shell?

As I understand bash is a program like python interactive shell, which receives command(or commands) by input stream, executes them by calling Linux API functions, and give execution result to output ...
1
vote
1answer
472 views

Looking for a complete(ish) u-boot shell syntax guide [closed]

I am looking for a complete(ish) u-boot shell syntax guide. Supposedly it is the Hush Shell, but I cannot find good guides for this shell either.
2
votes
1answer
100 views

How to automate a keystroke to a cli terminal appilcation like ranger?

I'd like to send a keystroke to ranger, when I have ranger running and have gotten it's PID with: Output of ps aux | grep '[/]usr/bin/python -O /usr/bin/ranger': chris 5054 3.1 0.1 116248 ...
2
votes
3answers
269 views

How to move all files matching a certain name to a new folder if the number of matching files is greater than 10?

I'm looking to create a script that when executed it will look at a directory and search for all files and then automatically discover the filename patterns to then move them based on additional logic ...
0
votes
2answers
49 views

Any way to recall the file of previous cmd? [duplicate]

Frequently I’ll have to do some digging around to figure out what I’m doing on linux, involving quite a bit of ‘’, ‘ls -la’, ‘cd’, ‘cat’, and ‘vim’ Is there any way to quickly reuse the file/target ...
0
votes
1answer
138 views

Linux Server Calculating NIC I/O AVG on eth0

I am trying to calculate NIC I/O AVG say for eth0 which is a 10GIG Interface during a specific time frame on my Linux server....I need NIC I/O AVG for One hour during a load test to check to see the ...
1
vote
1answer
61 views

Error when forking a for loop?

In a forked shell, I’m trying to run a code that takes two input files and outputs four files. Here's an example of what I'm trying to execute within the for loop -- it does produce the results I ...
0
votes
2answers
1k views

Concatenate 2 binary strings in base64 form

I have two BASE64 encoded strings and I would like to get the BASE64 encoding of the binary concatenation of the two string using just the command line. Example: > $ echo -n "\x01\x02" |base64 ...
0
votes
1answer
890 views

How to see constant values in .a lib files?

I declared a constant using define statement in my C file. #define COMPRESSION_VERSION 1.0.0 Now I have created libcompression.a library which includes the above C file. Now I need to check my ...
0
votes
2answers
812 views

Run/stop command in terminal without human interference?

As a beginner Linux user I'm facing with the little problem. I have 1 command in terminal like in the picture: When I run this command it will generate some lines, but the problem is I need to make ...
5
votes
5answers
1k views

Find fullpath and filename under a directory then pass to an executable file as arguments

I'd like to find fullpath and filename of all .txt under a directory, and pass to a executable file ./thulac . It cost me some time to reach: find /mnt/test -name "*.txt" -print0 |xargs -l bash -c '....
0
votes
1answer
189 views

command grep troubleshooting [closed]

I have the following task from school: List all the lines from the file find_config, who starts with etc. I put this command in: the problem is that I see from that file (find_config) that it has ...
5
votes
4answers
578 views

Check whether console application is really exited

Suppose that I have started a console application which finishes, then shell prompt brings up again. But how can I be sure that it's the real command prompt? What if, for example, the application is a ...
-1
votes
1answer
552 views

What does this command do?

cat telephone.txt | cat | cat | sed -e "s/t/T/" | tee cible | wc -l
3
votes
2answers
569 views

Extract unique single commands from history

I have created a file called histcopy.txt with the command history, (history > histcopy.txt). It look somewhat like this: 1. l 2. ls 3. cat necopy.txt 4. netstat 5. cd | ls-l ; grep -i "3" ...
-2
votes
1answer
439 views

How do I get a specific string using ps command in linux [closed]

For instance, consider the following example. I have a process running on my machine and I only want a specific string in my output. When I run the following command ps -ef | grep pmon I get ...
1
vote
1answer
690 views

How to pass Command to program open in shell?

I am writing a shell script to auto-deploy a program with Jboss-cli, in linux ubuntu. I need to open the jboss cli interface and execute some commands but I want to do this automatically. what it ...
0
votes
2answers
134 views

How do I turn on terminal output in CentOS 6.8?

When I run the command service httpd restart the service restarts but there is no feedback to tell me that the server restarted successfully. Previous servers output a response like shutting down ...
16
votes
2answers
39k views

A quicker way to change owner/group recursively? [duplicate]

Currently, when I want to change owner/group recursively, I do this: find . -type f -exec chown <owner>.<group> {} \; find . -type d -exec chown <owner>.<group> {} \; But ...
2
votes
1answer
948 views

Understanding the following find command

I am currently having a hard time understanding the following find command: find / -o -group `id -g` -perm \  -g=w -perm -u=s -o -perm -o=w\ -perm -u=s -o -perm -o=w \ -perm -g=s -ls  ...
-1
votes
3answers
799 views

How to swap two words with sed and with multiple delimiters?

Just letters are accepted in words, any other characters are delimiters. I want to exchange the first word with the third word. sed -E 's/([A-Za-z]+) [^A-Za-z] ([A-Za-z]+) [^A-Za-z] ([A-Za-z]+)/\3 \2 ...
5
votes
5answers
3k views

What does pwd output?

Does the command pwd in a shell script output the directory the shell script is in?
4
votes
1answer
675 views

How the terminal can run programs and show its output? [closed]

I'm slowly creating a mental model of how linux works, and I've tried to simplify the most, my model of how linux works. Let's assume that the kernel boots and inits the only software it's gonna run: ...
5
votes
3answers
7k views

How to practice for command line? [closed]

I am reading The Linux Command Line: A Complete Introduction to learn about the command line. The book is great. However, there is a major problem for me: It does not have exercises/projects at the ...
19
votes
5answers
1k views

Commands to learn about an unfamiliar system [closed]

You log in to an unfamiliar UNIX or Linux system (as root). Which commands do you run to orient yourself and figure out what kind of system you are on? How do you figure out what type of hardware is ...
0
votes
2answers
138 views

Remove leading 10-digit number from filenames

I have thousands of image files that have a 10-digit number appended to the beginning of the filenames. Immediately following each string of 10 numbers is an underscore. They look like this: ...
0
votes
3answers
159 views

print last line of !! command

so I want to be able to print helloworld using the !! command. I tried creating a text file with the text helloworld on it. Then I say cat textFileName It prints helloworld. Then I say !! and it ...
0
votes
2answers
864 views

Display CPU cores usage in percentage without using top

I am using java to run a command on linux. Since top is an interactive command and need to press 1 to get the info of all the cpu(s) so I cannot use that. So I am using the following command to get ...
2
votes
1answer
649 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
423 views

Host linux distro without GUI?

I saw this video on Youtube: Run Kali Linux on Android The phone uses the app: Linux deploy, which uses the phone to host the distro, but there's is no GUI. The only way to connect to Kali, is by ...
0
votes
2answers
304 views

How to grep from command line for theses multiple strings?

I need to run a command to grep one of these strings from command line as web host disabled account to run website from browser until virus files are removed and I managed to collect few strings that ...
2
votes
1answer
2k views

Debian Linux: Start/run application/process in another virtual terminal

You'll have to bare with my my Linux terminology is pretty bad. When I say virtual terminal I'm talking about when you press ctrl+alt+ a function key (F1-F12). I think they are called virtual ...
2
votes
2answers
2k views

Save and restore terminal tabs with custom tabs title

I have a Terminal window with a dozen named tabs open *(gnome-terminal) I would like to save the current configuration and have it restored with names and directories. Is there a way to do this? I've ...
26
votes
1answer
4k views

Why does BASH process substitution not work with some commands?

On occasion process substitution will not work as expected. Here is an example: Input: gcc <(echo 'int main(){return 0;}') Output: /dev/fd/63: file not recognized: Illegal seek collect2: error: ...