When trying to save a file in vim I used the ls command to see the folder I want to save in. I got the following output after using the ls command:
Obviously that's not the contents of the folder. Can anyone tell me why that's happening and how to fix it? Thanks :)
ls is a call to ls command in the shell == list of your files in the working dir. :ls is a Vim built-in command, which shows content of buffer list == list of your open files.
First Go to command mode in vi editor by pressing 'esc' key and then type “:“, followed by “!” and the command, example is shown below. Example : Run the ifconfig command within the /etc/hosts file.
The ls command is used to list files. "ls" on its own lists all files in the current directory except for hidden files.
gg | G. These commands let you move around the entire file. gg will move you to the first line in the file, and G will move you to the last line in the file. Alternatively, if you type nG where n is a number, you'll jump to that to that line.
Try these two commands
:help :ls
:!ls
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With