What am I doing wrong, sort and remove dups

None-yet

Member
Joined
Aug 10, 2020
Messages
78
Reaction score
32
Credits
906
Someone , anyone, help! lol

I have a file to sort and remove dups. I am using cat sort -u unsorted.txt and I think that is correct but as per below I must be doing something wrong. I know I am a bit rusty but what am I doing wrong?
oot@kali:~/Desktop# cat sort -u unsorted.txt
cat: sort: No such file or directory
cat: unsorted.txt: No such file or directory
root@kali:~/Desktop#


Thanks
 


Someone , anyone, help! lol

I have a file to sort and remove dups. I am using cat sort -u unsorted.txt and I think that is correct but as per below I must be doing something wrong. I know I am a bit rusty but what am I doing wrong?
oot@kali:~/Desktop# cat sort -u unsorted.txt
cat: sort: No such file or directory
cat: unsorted.txt: No such file or directory
root@kali:~/Desktop#


Thanks
You don't need to cat the file in order to sort it, you can just use sort alone on the file your want to sort. The file unsorted.txt isn't located in the Desktop directory, you probably saved the file to a different directory. Try to find it like this:
Code:
find /home/username -name unsorted.txt
Replacing username with your user, which you used to log into the system.
 
Last edited:
Yeah, the file is on the desktop. That's part of what I didn't understand. I tried with and without cat and neither worked.

Lost my other computer in a tornado earlier this year here in Chattanooga. Did a "Don't remember my password" but got no return on the email. Thought I may have used a long lost email.
 
Yeah, the file is on the desktop. That's part of what I didn't understand. I tried with and without cat and neither worked.

Lost my other computer in a tornado earlier this year here in Chattanooga. Did a "Don't remember my password" but got no return on the email. Thought I may have used a long lost email.
Right now cat thinks sort(which doesn't exist) is a file. Seems unsorted.txt isn't seen as well, that is strange.
 
Last edited:
Can you show an ls -l of your Desktop directory.
 
root@kali:~/Desktop# cat sort -u unsorted.txt
cat: sort: No such file or directory
cat: unsorted.txt: No such file or directory
root@kali:~/Desktop# ls -i
11541716 prerelease 11541713 unsoted.txt
root@kali:~/Desktop#

That makes me so mad. As soon as I saw it come up I saw I had misspelled it. Stop laughing. Dad-gum that burns me. Like I said I am rusty.

One last thing. Before I mess up again, what would be the correct syntax to sort > remove dups > output to another file?
 
Everybody makes mistakes, mistakes are learning opportunities;) I'm not sure what you mean by "remove dups"
 
Everybody makes mistakes, mistakes are learning opportunities;) I'm not sure what you mean by "remove dups"
Oh, do you mean remove duplicates?
Code:
sort -u unsorted.txt > output.txt
Als I meant ls -l(as L in Linda but lowercase). Try man ls.
 
Yessir, my shorthand. OK, great, Thanks. I need a break. I am still burning but sure many will see this and enjoy. Thanks again for the rescue!
 
Yessir, my shorthand. OK, great, Thanks. I need a break. I am still burning but sure many will see this and enjoy. Thanks again for the rescue!
No problem! And welcome to linux.org! Be sure to drop by and introduce yourself in the Introduction Section so you can meet the other members! :)
 

Members online


Top