The command is : ps -c -p | tr -s ” ” | cut -d ” ” -f 2,6-10,13 | grep ‘R’ I am running it through adb shell. Basically, I want a list of processes (and certain parameters) which are currently in the run queue. This is working fine if I run it directly through the shell. However, if
Tag: command-line
Using find to rename files recursively with random chars
I have an IP camera that takes snapshots and nests those snapshots into multiple directories. The sub directories look something like this. There is a ton of sub directories because of the way it stores files since it places those snapshots within a Minute directory of the Date/Hour directories. At any rate, there are other types of files mixed in,
linux find command: exclude path from result
I used the find command to find all python files in a folder, and exlude some folder. find . -type d ( -path ./venv -o -path ./virtualenv -o -path ./lib ) -prune -o -iname ‘*.py’ It’s give the following output: How can I tweak the find command to exclude ./venv in the resultset? Answer If you don’t specify any actions,
I want to extract any text between two symbol
I need to execute the file (a.out) and at the same time, I just need specific parts of the output, not everything. which is either located between these two string [[….]] or ((…..)). and I don’t have any idea where the other text is located (there is no specific pattern) and how the output looks like? for example: if I
How to write an alias in csh/tcsh that can write one file with shebang?
I want to write one script with my alias but not able to add bang line in my script with echo command. I tried these ways: If I run these lines without alias then they work for me. With direct typing and using command I’ll get data in file cshCMD.csh as: #!/bin/csh ncl while when I use alias on command
Shell: Pass function with arguments as function argument
I’m working on a shell program to automatise my Arch (mandatory btw) installation. To make it more interactive, I’ve built the following function: I’ve succeeded in passing an “echo Hello World!” as an argument and having it run. I’ve also been able to pass another function. For example: This calls yayinstall if yes and does nothing if no. My problem
Bash script, find command, using wildcards or regex
I am writing a bash script that goes over all files in certain directory and: Picks the files with names that match a specified pattern Sorts them by data and time (date and time are part of the filename) Takes X oldest files Performs certain operations on them The pattern used to match the files is passed to the script
Problem with special filenames when trying to pull android files into windows pc recursively using adb
I want to download all files from /data/data/foo folder to my pc. I am using adb to connect with my phone. To download files I am using: And here’s response: And in fact, only this is copied: What I am doing wrong here? Answer The problem: What you’re doing is right (the command is correct), but the problem comes from
Interleave lines sorted by a column
(Similar to How to interleave lines from two text files but for a single input. Also similar to Sort lines by group and column but interleaving or randomizing versus sorting.) I have a set of systems and tasks in two columns, SYSTEM,TASK: I want to distribute the tasks to each system in a balanced way. The ideal case where each
Difference between *.* and * when used with the cp command and the -R parameter [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question