Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [command-line]

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

15
votes
2answers
1k views

Date Command Gives Wrong Week Number for Dec 31

When I try to get the week number for Dec 31, it returns 1. When I get the week number for Dec 30, I get 52 --- which is what I would expect. The day Monday is correct. This is on a RPI running Ubuntu....
0
votes
0answers
11 views

Get URL content including parsed javascript

I know there are a lot of CLI tools to get data from URL like curl, wget, lynx and so on. Problem is that I need to get data that is created with javascript. For example URL outputs table with data ...
-1
votes
1answer
53 views

Size command is not recognized, thought installed correctly

I am working on macOs and tried size command on cc $ which cc /usr/bin/cc it does not work correctly $ size /usr/bin/cc size: /usr/bin/cc: unknown load command 0x32 size: /usr/bin/cc: unknown load ...
-1
votes
1answer
44 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 --...
0
votes
0answers
12 views

Distcp from hadoop to aws

I have to transfer files from hadoop cluster to AWS bucket. Below is the command i am using. hadoop distcp -Dmapreduce.job.queuename=root.mr.sbg.sla -Dfs.s3n.proxy.host=qy1prdproxy02.ie.xxx.net -Dfs....
0
votes
1answer
16 views

changing wifi password over SSH on wifi-only headless server

I want to change the password for my wifi network foo. I've got a raspberry pi connected to foo. I only use SSH to talk with it. The pi is headless, and it isn't convenient to attach a monitor+...
0
votes
3answers
19 views

How can we generate the session token in aws

i have aws access key and secret key with me. i wanted session token to be updated in aws credential file (~/.aws/credentials), how will i get it? I want them to be generated in command line.
0
votes
0answers
22 views

Find history of disk io and process name?

I have grafana+prometheus monitoring setup on my CentOS machine. I can see there was a high disk I/O an hour ago. How can I find out through command line that which process was doing I/O at that time ...
6
votes
2answers
233 views

Is it possible to get aws account id with only aws access key and secret key in command line (CLI)

Is it possible to get aws account id with only aws access key and secret key in command line (CLI) I have access key and secret key with me. Is it possible to get the account id using those in ...
0
votes
1answer
29 views

How to see which files are identical given a list of files in two projects

I have two projects named project1 and project2 with identical file trees as follows. project1/, project2/ . ├── src │ ├── index.html │ ├── main.js │ ├── normalize.js │ ├── routes │ │ ├──...
0
votes
1answer
15 views

“No such file or directory” when running node script [duplicate]

/usr/bin/env: ‘node\r’: No such file or directory I keep receiving this output when i try to run something. Any ideas on how to fix this?
1
vote
1answer
22 views

How Do I Find The Mobile Provider From 4G Dongle?

I have two or more 4G dongles connected via USB. I have set up multiple configuration files (one for each provider), but short of a visual inspection (which for this project won't be possible in the ...
0
votes
1answer
22 views

Query unread emails count from Thunderbird via terminal

I want to add to i3 status bar indicator showing number of unread emails in Thunderbird profile. Since Thunderbird itself doesn't have command-line options to get that info, I've tried to query it's ...
5
votes
2answers
134 views

Perl command line regex to modify all pattern matches

I'm trying to use some arithmetic over the matched patterns in perl command line. I'm able to do it for one match but not for all. str="a1b2c3" perl -pe 's/\d+/$&+1/e' <<<"$str" a2b2c3 ...
-1
votes
1answer
16 views

Command line generates different hashsum than online hash generator… [duplicate]

Input text: test Online MD5 hashsum generator: 098f6bcd4621d373cade4e832627b4f6 echo "test" | md5sum: d8e8fca2dc0f896fd7cb4cb0031ba249 Also the same happens to sha512sum and sha1sum. Why does Linux ...
0
votes
2answers
34 views

Writing file to specific USB device

I am looking to write the output of cat /var/log/dpkg.log to a file rather than viewing on the screen. I have tried cat /var/log/dpkg.log | file.txt without any success. Ultimately I want ...
1
vote
3answers
51 views

Is it possible to search for a file using the checksum instead of the name? [duplicate]

Suppose I want to do a search to find out if I have a file that matches the sha256 generated from the file test1.txtusing the command: sha256sum -b test1.txt I get as output: ...
1
vote
2answers
64 views

Understanding sudo and possible exploit

I'm doing some hands on pen testing and following some guides to get an understanding of the tools of the trade. I'm following along with the guide here and I understand everything except for the last ...
1
vote
1answer
32 views

Debian: Remove redundant package terminology

When I install a LAMP server environment on Debians I use this code: apt-get upgrade lamp-server^ php-cli php-curl php-mbstring php-mcrypt php-gd python-certbot-apache -y If I add more php-X ...
2
votes
1answer
28 views

Uptime command misconception with suspend and resume states

The definition for uptime is "Tell how long the system has been running." but if you change your system power state to suspend or resume: # uptime 09:50:33 up 8 min, 2 users, load average: 0,24, 0,...
1
vote
2answers
28 views

How to find accumulated duration on several mp3 with command line?

I have a directory with a lot of mp3 files, and I need a simple way to find the accumulated duration for them. I know that I can find the duration for one file with ffmpeg -i <file> 2>&...
0
votes
2answers
27 views

How to copy all files in all directories with specific filename to one destination?

Let's assume that I have these files: /1/tEst.mp4 /1/Test.mP4 /1/subdirectory/TEST2.mp4 /1/.20181106Test2.mp4 How can I copy all of these files into /2/Videos with a single command line? All files ...
1
vote
1answer
30 views

Commands suggested by apropos are not working

I was trying to look for encryption commands with apropos: apropos encrypt A lot of them don't work, for example: gpgsm, setkey, passwd2des etc. When I type them I just get: bash: command_name: ...
-1
votes
0answers
44 views

How to remove middle folder from the path in Linux?

I have a mp4 files in the folders looks like: folder1/folder2/folder3/some_video1.mp4 folder1/folderA/folderZ/some_video4.mp4 folder1/folderB/folderXYZ/some_video3.mp4 etc.. and I want to remove ...
1
vote
2answers
49 views

Almost every CLI music player doesn't work (in an SSH terminal)

Goal: Play music on a server, preferably using cmus, using SSH for player control. First try: cmus I run cmus in a terminal, literally nothing happens. It just loads (i guess). Tried cmus -vvvvv - ...
-1
votes
1answer
28 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
0
votes
2answers
38 views

Find the longest file name

I have to find the symbolic link which contains the longest folder name in a folder full of symbolic links. So far I have this: find <folder> -type l -printf "%l\n" I was wondering if there's ...
0
votes
2answers
59 views

How to check SMB connections and the dialect that is being used on linux?

I want to check the dialect version in SMB connections. On Windows, Get-SmbConnection will get it. PS C:\Windows\system32> Get-SmbConnection ServerName ShareName UserName Credential ...
2
votes
2answers
32 views

Bash: how to properly accept user input?

I couldn't find an example online but I'm sure I've seen shell coders use ${1:--} to accept user input. Here's an example: #!/bin/bash var="${1:--}" echo "$var" Then, run it: $ ./test.sh "this is ...
1
vote
1answer
29 views

How can I view a cheatsheet/summary of a syntax construct of zsh in zsh itself? [closed]

I want something like the doc function in Clojure; I want to type cheat for and be shown some example usages of for in zsh. I don't mind installing an app for this, and I hope something like this has ...
-1
votes
0answers
25 views

Check the new mail from bash [duplicate]

There is constantly a new mail reminder on the head of bash Last login: Sat Oct 27 18:07:36 on ttys000 You have new mail. Usually, I tends to ignore it and check my outlook inbox later. but,I ...
0
votes
2answers
32 views

How to add multiple directories like the name 1-100 in one command

I need to create multiple directories using one command.  Is it possible? Like directory name starts from 1-100. mkdir 1..100
0
votes
1answer
85 views

How to extract the lines that have the given sequence?

I am trying to find a command that is extracting only the lines that have all their characters in a sequence and in the order as below from a text file. 800900100011001200..(descending by 100) ...
0
votes
0answers
20 views

How do I know if a device is still responsive?

An internal optical drive sometimes ceases to work on an external SATA adapter, connected via USB. If I connect it, it sometimes freezes forever (until powered off). What is a Linux command that ...
1
vote
2answers
61 views

Create hardlinks instead of copying files with rsync

The following command finds recursively all files containing foo (but not bar) and preserves the directory structure in the target directory, for example if I have /path/to/2017/foo.ps and /path/to/...
0
votes
1answer
26 views

How to run a web page with cache refresh using chromium-browser and command line?

I can start a web page with command line like that cromium-browser http://some-page.com. How can I start a web page with command line and with hard refresh cache option (equivalent of CTRL-F5 if I ...
0
votes
0answers
13 views

iTerm2 - Frequently stuck alternating input between bash and repl

Frequently getting iTerm2 panes stuck where input alternates between bash and whatever repl (or really any other command) I happen to be running. For example, repeatedly hitting enter might give the ...
0
votes
1answer
23 views

Piping PID into jstack

I've written a command line that effectively extracts the highest CPU java PID thread process from top -H (example code): top -H -n 1 | grep "java" | head -n 1 | cut -d' ' -f1 I want to inspect the ...
-1
votes
0answers
34 views

How to edit this command?

I'm filtering a text file with numbers and names I have these commands sed -En 'h;:a;s/^(.)\1+//;ta;/^$/{x;p}' file perl -lne 'print if /^((.)\2+(?!\2))+$/' file For printing only the lines with all ...
0
votes
1answer
61 views

How to edit this command to add another feature?

I have below commands for extracting only the lines that will all consecutive duplicates two or more times I want to edit these sed and perl commands to exclude the first and the second character from ...
0
votes
1answer
35 views

How to redirect output to file to STDOUT?

Similar problem as here How to redirect output from file to stdout? However, the solution given there is not universal. My problem: I have a command that produces output to STDOUT. At the same time, ...
1
vote
0answers
52 views

How to print specified lines only?

I want to specify the output from text file in one command as below: Print all lines that have all consecutive duplicate characters. Print all lines with all consecutively repeated characters except ...
1
vote
0answers
19 views

Style guide for command line tools' console output? [closed]

Is there a Unix/Linux style guide or similiar, how a program's console output should look like? Preferrably with some explanations about the background (why is a rule important..).
0
votes
1answer
21 views

Getting the audio-playtime of a folder from the command line

Is there a way/tool for the linux command-line (bash) to get the overall audio playtime of a certain directory? Something like: playtime --all --recursive /Music/DrumAndBass/ output: 1:35:06
0
votes
3answers
124 views

How to list full path of files/directories using only ls command (working in a restricted shell)

I have restricted shell on Production environment servers in my company, leaving me with handful of command choices. I am trying to get full path of files/directories using only ls command. I can't ...
0
votes
1answer
14 views

How to list versions of the same package in Linux Mint (Debian) by command line

In OpenSuSE via Yast you can choose the version of a package to install it. How could I do the same in Linux Mint?
0
votes
1answer
14 views

Adminstering GoDady using CLI/API

Is there any tool CLI/API where one can automate the GoDady DNS related operations such as addind/removing DNS records and managing SSL certificates and domain names? without wasting time around on ...
0
votes
1answer
35 views

find last 15 users that logged in - even if some of them already logged out

i need to find the last 15 users that logged in to the system. i know there are commands like 'w' or 'who' or 'users' but as much as i know those commands refer only to users currnetly logged-in. but ...
-1
votes
1answer
64 views

chmod all files in a directory [duplicate]

How do I change all files (different types including .sh, .py, and other executable files) in a known directory to permission 775 without listing all of the file names? I mean "all" of them in that ...
2
votes
1answer
44 views

Reduce size of my screen with a command line

I am running a Debian stable with Cinnamon graphical interface 3.6.7 and my computer is connected to a multimedia projector. I havea an Intel Graphic card. The projected image is too big and I can't ...