简体   繁体   中英

How to append list of home directory to a text file and how to move files?

I know a very basic of unix and I am writing a java program which I only need couple of commands to solve my problem.

I appreciate if anyone knows how I can get desired output:

  1. What command I can use to append a full list of objects of my home directory to a file "report.txt". Assume I am in different directory?

  2. What command I can use to move all files in my directory that begin with either a, b, or c, to a subdirectory, sorting, of my current directory?

  3. If I go to /proc directory. What does this command do?

    cd 'ps | grep ps| cut -f 1'

I really appreciate if any one can help me out with these.

  1. What command I can use to append a full list of objects of my home directory to a file "report.txt". Assume I am in different directory?

    ls -la ~ > report.txt

  2. What command I can use to move all files in my directory that begin with either a, b, or c, to a subdirectory, sorting, of my current directory?

    mv a* b* c* yourdirectory

  3. If I go to /proc directory. What does this command do?

    cd 'ps | grep ps| cut -f 1'

    This command will give "bash: cd: ps | grep ps| cut -f 1: No such file or directory" error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM