command

How do I run multiple Unix commands? [closed]

无人久伴 提交于 2019-12-13 09:36:02
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . So I have to run a cut and a sort file at once. I'm using this command: sort -k2 customers;cut -f7-31 customers The objective is to cut lines 7-31 then organize them in alphabetical order but I am not sure how to achieve it. Any input will help, thank you. 回答1: The objective is to cut lines 7-31 ... You can use

How to I start example.txt as a Notepad or a Word document through cmd

浪子不回头ぞ 提交于 2019-12-13 09:22:27
问题 Im trying to start a given file as a notepad or a word document, not open a new notepad or word document 回答1: example.txt or start example.txt or notepad example.txt or start notepad example.txt 回答2: In cmd, you can just type 'notepad example.txt'. 来源: https://stackoverflow.com/questions/20168227/how-to-i-start-example-txt-as-a-notepad-or-a-word-document-through-cmd

specify directories architecture skip one level

喜你入骨 提交于 2019-12-13 08:50:51
问题 the directories looks like ./2012/NY/M/ ./2012/NJ/F/ and .etc I'd like to find all files under /f no matter which state it is in How should I write? I tried ./2012/*/F but it does not work... 回答1: ./2012/*/F should return you all the directories no matter the state. If you want the files under that, you've got to glob for them too: ./2012/*/F/* 来源: https://stackoverflow.com/questions/18966457/specify-directories-architecture-skip-one-level

Unix/Linux display average file size with restriction

≡放荡痞女 提交于 2019-12-13 08:48:17
问题 how do I display the average file size (rounded down). Use only: cat, echo, ls, wc, here is what I was able to do so far: echo "$(cat * | wc -w; ls -l | wc -l)" I have both of the numbers, I just can't divide them, any help would be appreciated and thanks in advance 回答1: Is it allowed to use the shell for the division? $ ls -l total 20 -rw-r--r-- 1 james james 968 Dec 29 2016 bar -rw-r--r-- 1 james james 900 Dec 29 2016 bar.asc -rw-r--r-- 1 james james 39 Dec 29 2016 compr.txt -rw-r--r-- 1

this dyld: unknown required load command 0x80000022 error is killing me exclamation point goes here

亡梦爱人 提交于 2019-12-13 08:27:42
问题 I have a 2.2 mac Core 2 Duo - I think they call my mac Santa Rosa or something. I've spent the last three months on App Inventor - after realizing I can't use admob or Airpush - I decided to start learning java. I've been watching a set of 200 tutorials by thenewboston and it is great! Only problem is, i can't start the emulator. I think it has something to do with the fact when it asks me how much space the sdcard should hold - when i try to prEss enter - it won't let me continue.. [2013-01

Executing a Process in Android to read a file

情到浓时终转凉″ 提交于 2019-12-13 08:19:43
问题 I need to read the content of a file using a Linux Shell Command executed using Java in Android. What command do I need to execute in order to read all the text in the file and save in a String object? Note that I can't use the simple Java I/O functions! The file that I need to read is in the device's system directory. String command= ""; String file_path = "misc/file.txt"; StringBuffer output = new StringBuffer(); Process p; try { p = Runtime.getRuntime().exec(command); p.waitFor();

Creating an alias [closed]

▼魔方 西西 提交于 2019-12-13 07:55:16
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 months ago . Create an alias for srm (safe remove), such that everytime srm is used, an interactive rm command runs, e.g. rm –i. This change needs to be made to the necessary configuration files such that the alias is set every time any user logs in. Also show that your alias works. How would i go about doing this? 回答1:

Created zip file contain folder structure using tar command in PHP

≡放荡痞女 提交于 2019-12-13 07:18:32
问题 I am trying to create a zip of all files in abc folder with the name filename.zip using following command in php like: exec(tar -cvf filename.zip /home/public_html/uploads/abc/) but the created zip has the folder structure home/public_html/uploads. Please help me to get rid of these folders. 回答1: exec("tar -cvf filename.zip -C /home/public_html/uploads/ abc/") Note the space before 'abc/'. The -C switch tells tar to first change directory to /home/public_html/uploads and then compress 'abc'

Why commands with ssh2_exec do not end?

雨燕双飞 提交于 2019-12-13 07:17:55
问题 I have a problem running a command on my server remotely with ssh2_exec. When I use wget or unzip, the command should execute but I get no result or only a few files. What I need to know is how I can be sure that my ssh2_exec script will execute fully before proceeding to the rest of my PHP code. $stream =ssh2_exec($connection, 'cd /home; wget http://domain.com/myfile.zip; unzip myfile.zip; rm myfile.zip'); Thanks in advance! EDIT : I have found script, how get result of commands ? <?php $ip

Batch script read file and set to environment variable

你说的曾经没有我的故事 提交于 2019-12-13 07:06:10
问题 I am writing a shell script to read a file containing key=value pair and set those variables into environment variable. I tried with the below code, if EXIST "test.dat" ( for /F "tokens=*" %%I in (test.dat) do @set %%I echo setting JAVA_HOME to :: %JAVA_HOME% echo setting JAVA to %JAVA% ) Assuming the test.dat has JAVA_HOME=c:\JDK1.6 and JAVA=c:\JDK1.6\bin\java Running the above code is not setting these variables, even though I have set %%I statement in do . The two echo statements are not