Running commands in backgroud

I have a small question may be this will be discussed before

I have two files file1 and file2 with huge data and I am running the commands as

cat file1 |sort &
cat file2 |sort &

If the session is got disconnected or logout will this command run in background,
or shall we use nohup

Get rid of the cats and use nohup:

nohup sort -o sorted1 file1&
nohup sort -o sorted2 file2&

I just need to know this command will run in background if the session got disconnected.

Yes, if you use nohup, it will continue to run in background if session is disconnected. That's the whole point of nohup.